Professional Documents
Culture Documents
CO Nos. Course Outcomes Level of Learning Domain (Based On Revised Bloom's)
CO Nos. Course Outcomes Level of Learning Domain (Based On Revised Bloom's)
Tas
S.No VTUNo Name
k
1 VTU12021 KURAPATI RAJENDRA PREM KUMAR 1
3 VTU12238 V POOVENDHAN 1
4 VTU12325 T RAJADURAI 2
5 VTU12326 S KABILDEV 2
6 VTU12329 M SABARI 2
7 VTU12389 A JASON 3
10 VTU12394 C ANURAG 4
5
13 VTU12427 SARAVANAN AKASH BALA
1
15 VTU15977 MANISH KUMAR 5
27 VTU17352 NARAHARISETTIMAHALAKSHMI 9
35 VTU17759 K SRIVASANTHI 12
GROUP - 1
2
K
S.No List of Questions CO VTU Nos
Level
1 Array Manipulation 1 3
Starting with a 1-indexed array of zeros and a list of operations, for
each operation add a value to each the array element between two
given indices, inclusive. Once all operations have been performed,
return the maximum value in the array.
abk
153
487
691
Add the values of between the indices and inclusive:
VTU12021
index-> 1 2 3 4 5 6 7 8 9 10 VTU12057
VTU12238
[0,0,0, 0, 0,0,0,0,0, 0]
[3,3,3, 3, 3,0,0,0,0, 0]
[3,3,3,10,10,7,7,7,0, 0]
[3,3,3,10,10,8,8,8,1, 0]
The largest value is after all operations are performed.
Function Description
Returns
3
int - the maximum value in the resultant array
Input Format
The first line contains two space-separated integers and , the size of
the array and the number of operations.
Each of the next lines contains three space-separated
integers , and , the left index, right index and summand.
Constraints
Sample Input
53
1 2 100
2 5 100
3 4 100
Sample Output
200
Explanation
After the first update the list is 100 100 0 0 0.
After the second update list is 100 200 100 100 100.
After the third update list is 100 200 200 200 100.
The first line contains an integer , the number of nodes in the tree.
node[i].data.
4
Note: Node values are inserted into a binary search tree before a
binary search tree, all nodes on the left branch of a node are less
than the node value. All values on the right branch are greater than
Constraints
Sample Output
GROUP - 2
K
S.No List of Questions CO VTU Nos
Level
5
meaning that the corresponding list is empty. VTU1232
6
Example VTU1232
9
Function Description
Returns
The first line contains an integer , the length of the first linked list.
The next lines contain an integer each, the elements of the linked
list.
The next line contains an integer , the length of the second linked
list.
The next lines contain an integer each, the elements of the second
linked list.
Constraints
6
3
4
Sample Output
12334
Output Format
Print the tree's preorder traversal as a single line of space-separated
2 values. 2 2
Sample Input
1
\
2
\
5
/ \
3 6
\
4
Sample Output
125346
GROUP - 3
7
Level
Example
head refers to the first node in the list 1->2->3
data=4
Position=2
VTU12391
head: a SinglyLinkedListNode pointer to the head of the list
Returns
8
Sample Input
3
16
13
2
Sample Output
16 13 1 7
Explanation
The initial linked list is 16->13->7. Insert 1 at the position 2 which
currently has 7 in it. The updated linked list is 16->13->1>17.
Given the root node of a binary tree, can you determine if it's also a
binary search tree?
9
function as an argument.
Constraints
Output Format
You are not responsible for printing any output to stdout. Your
function must return true if the tree is a binary search tree;
otherwise, it must return false. Hidden code stubs will print this
result as a Yes or No answer on a new line.
Sample Output
No
GROUP - 4
K
S.No List of Questions CO VTU Nos
Level
10
1 Queue using Two Stacks 1 3
11
For each query of type , print the value of the element at the front of
the queue on a new line.
Sample Input
STDIN Function
----- --------
10 q = 10 (number of queries)
1 14 enqueue 42
1 28 enqueue 28
1 60 enqueue 60
1 78 enqueue 78
14
2 HEAP 2 2
This question is designed to help you get a better understanding
of basic heap operations.
12
"" - Print the minimum of all the elements in the heap.
Constraints
Output Format
For each query of type , print the minimum value on a single line.
Sample Input
STDIN Function
----- --------
5 Q=5
14 insert 4
19 insert 9
3 print minimum
24 delete 4
3 print minimum
Sample Output
4
GROUP - 5
13
Lev
No O
el
In each move, Nick can remove one integer from the top of either
stack a or stack b.
Nick keeps a running sum of the integers he removes from the two
stacks.
Nick is disqualified from the game if, at any point, his running sum
becomes greater than some integer maxsum given at the beginning of the
game.
Given ,a ,b and maxsum for g games, find the maximum possible score
Nick can achieve. VTU12427
VTU13986
Example
VTU15977
a=[1,2,3,4,5]
b=[6,7,8,9]
The maximum number of values Nick can remove is 4. There are two sets of
choices with this result.
Function Description
Complete the twoStacks function in the editor below.
Returns
- int: the maximum number of selections Nick can make
Input Format
14
The first line contains an integer,g (the number of games). The 3 .g
subsequent lines describe each game in the following format:
Subtasks
Sample Input 0
1
5 4 10
42461
2185
Sample Output 0
4
2 Balanced Brackets 2 2
A bracket is considered to be any one of the following characters: (, ), {, }, [,
or ].
15
A matching pair of brackets is not balanced if the set of brackets it encloses
are not matched. For example, {[(])} is not balanced because the contents in
between { and } are not balanced. The pair of square brackets encloses a
single, unbalanced opening bracket, (, and the pair of parentheses encloses a
single, unbalanced closing square bracket, ].
Function Description
Returns
string: either YES or NO
Input Format
The first line contains a single integer n, the number of strings.
Each of the next n lines contains a single string , a sequence of brackets.
Output Format
For each string, return YES or NO.
Sample Input
STDIN Function ----- -------- 3 n = 3 {[()]} first s = '{[()]}' {[(])} second s =
'{[(])}' {{[[(())]]}} third s ='{{[[(())]]}}'
16
GROUP - 6
K
S. C
List of Questions Lev VTU Nos
No O
el
Example.
Function Description
Complete the minimumMoves function in the editor.
string grid[n]: an array of strings that represent the rows of the grid
Returns
17
Sample Input
STDIN FUNCTION
----- --------
3 grid[] size n = 3
.X.
...
Each of the median values is stored in an array and the array is returned for the
main function to print.
Note: Add formatting to the print statement.
Function Description
Complete the runningMedian function in the editor below.
runningMedian has the following parameters:
- int a[n]: an array of integers
Returns
- float[n]: the median of the array after each insertion, modify the print
statement in main to get proper formatting.
18
Sample Input
STDIN Function
6 a[] size n = 6
12 a = [12, 4, 5, 3, 8, 7]
4
5
3
8
7
Sample Output
12.0
8.0
5.0
19
4.5
5.0
6.0
GROUP - 7
K
S. C
List of Questions Lev VTU Nos
No O
el
Example
The two lists have equal data attributes for the first 3 nodes. List 2 is longer,
though, so the lists are not equal. Return 0
Function Description
Returns
20
Each of the next lines contains an integer, each a value for a data attribute.
Output Format
Compare the two linked lists and return 1 if the lists are equal.
Otherwise, return 0. Do NOT print anything to stdout/console.
For each test case, in a new line, print if the two lists are equal, else print .
Sample Input
2
2
Sample Output
0
2 Same Tree 2 2
21
Given the roots of two binary trees p and q, write a function to check if they
are the same or not.
Two binary trees are considered the same if they are structurally identical, and
the nodes have the same value.
GROUP - 8
K
S.No List of Questions CO VTU Nos
Level
22
You are given an array of people, people, which are the attributes of Vtu17100,
some people in a queue (not necessarily in order). Each people[i] =
[hi, ki] represents the ith person of height hi with exactly ki other Vtu17210
people in front who have a height greater than or equal to hi.
Example 1:
Output: [[5,0],[7,0],[5,2],[6,1],[4,4],[7,1]]
Explanation:
Person 0 has height 5 with no other people taller or the same height
in front.
Person 1 has height 7 with no other people taller or the same height
in front.
Person 2 has height 5 with two persons taller or the same height in
front, which is person 0 and 1.
Person 3 has height 6 with one person taller or the same height in
front, which is person 1.
Person 4 has height 4 with four people taller or the same height in
front, which are people 0, 1, 2, and 3.
Person 5 has height 7 with one person taller or the same height in
front, which is person 1.
Constraints:
23
All Elements in Two Binary Search Trees
Given two binary search trees root1 and root2.
Example 1:
Output: [0,1,1,2,3,4]
Example 2:
2 2 2
Input: root1 = [0,-10,10], root2 = [5,1,7,0,2]
Output: [-10,0,0,1,2,5,7,10]
GROUP - 9
K
S.No List of Questions CO VTU Nos
Level
Example 1:
Input:
[[], [1], [2], [3], [4], [], [], [], [], []]
Output:
Explanation:
q.pushFront(1); // [1]
q.pushBack(2); // [1, 2]
q.pushMiddle(3); // [1, 3, 2]
25
q.pushMiddle(4); // [1, 4, 3, 2]
Constraints:
2 2 2
Check If a String Contains All Binary Codes of Size K
Given a binary string s and an integer k.
Example 1:
Input: s = "00110110", k = 2
Output: true
Explanation: The binary codes of length 2 are "00", "01", "10" and
"11". They can be all found as substrings at indicies 0, 1, 3 and 2
respectively.
Example 2:
Input: s = "00110", k = 2
Output: true
Constraints:
26
1 <= k <= 20
GROUP - 10
K
S.No List of Questions CO VTU Nos
Level
Vtu17406,
The minimum absolute difference of an array a is defined as
the minimum value of |a[i] - a[j]|, where 0 <= i < j < Vtu17460
a.length and a[i] != a[j]. If all elements of a are the same, the
minimum absolute difference is -1.
x if x >= 0.
-x if x < 0.
Output: [2,1,4,1]
27
difference is |1-3| = 2.
Output: [-1,1,1,3]
Constraints:
2 2 2
Binary Search Tree Iterator
Implement the BSTIterator class that represents an iterator over
the in-order traversal of a binary search tree (BST):
28
BSTIterator(TreeNode root) Initializes an object of
the BSTIterator class. The root of the BST is given as part of
the constructor. The pointer should be initialized to a non-
existent number smaller than any element in the BST.
boolean hasNext() Returns true if there exists a number in
the traversal to the right of the pointer, otherwise
returns false.
int next() Moves the pointer to the right, then returns the
number at the pointer.
You may assume that next() calls will always be valid. That is, there
will be at least a next number in the in-order traversal when next() is
called.
Input
[[[7, 3, 15, null, null, 9, 20]], [], [], [], [], [], [], [], [], []]
Output
Explanation
29
20]);
bSTIterator.next(); // return 3
bSTIterator.next(); // return 7
bSTIterator.next(); // return 9
bSTIterator.next(); // return 15
bSTIterator.next(); // return 20
Constraints:
GROUP - 11
K
S.No List of Questions CO VTU Nos
Level
Vtu17647,
You are given two linked lists: list1 and list2 of
sizes n and m respectively. Vtu17743
The blue edges and nodes in the following figure incidate the result:
30
[1000000,1000001,1000002]
Output: [0,1,2,1000000,1000001,1000002,5]
Explanation: We remove the nodes 3 and 4 and put the entire list2
in their place. The blue edges and nodes in the above figure indicate
the result.
2 2 2
Binary Search Tree to Greater Sum Tree
Given the root of a Binary Search Tree (BST), convert it to a
Greater Tree such that every key of the original BST is changed to
the original key plus sum of all keys greater than the original key in
BST.
Example 1:
31
Output: [30,36,21,36,35,26,15,null,null,null,33,null,null,null,8]
Constraints:
GROUP - 12
K
S.No List of Questions CO VTU Nos
Level
Example 1:
Output: true
32
Explanation: We might do the following sequence:
pop() -> 4,
push(5),
Example 2:
Output: false
Constraints:
2 2 2
Verify Preorder Serialization of a Binary Tree:
One way to serialize a binary tree is to use preorder traversal. When we encounter a
non-null node, we record the node's value. If it is a null node, we record using a sentinel
value such as '#'.
33
It is guaranteed that each comma-separated value in the string
must be either an integer or a character '#' representing null
pointer.
GROUP - 13
K
S.No List of Questions CO VTU Nos
Level
Example 1:
Input: s = "abcabcbb"
Output: 3
Example 2:
34
Input: s = "bbbbb"
Output: 1
Constraints:
Divide Apples
Problem
N boys are sitting in a circle. Each of them have some apples in their
hand. You find that the total number of the apples can be divided by N. So
you want to divide the apples equally among all the boys. But they are so
lazy that each one of them only wants to give one apple to one of the
neighbors at one step. Calculate the minimal number of steps to make
each boy have the same number of apples.
Input
The first line of input is an integer N. 2 <= N <= 10000 The second line is
N integers indicates the number of apples of the ith boy. Each integer is
2 positive and no more than 10^9. 2 2
Output
A single line contains the minimal number of steps to make each boy have
the same number of apples.
Sample Input
1397
Sample Output
35