A 3-ary max heap is like a binary max heap, but instead of 2 children, nodes have 3 children. A 3-ary heap can be represented by an array as follows: The root is stored in the first location, a[0], nodes in the next level, from left to right, is stored from a[1] to a[3]. The nodes from the second level of the tree from left to right are stored from a[4] location onward. An item x can be inserted into a 3-ary heap containing n items by placing x in the location a[n] and pushing it up the tree to satisfy the heap property.

F

Which one of the following is a valid sequence of elements in an array representing 3-ary max heap?

1, 3, 5, 6, 8, 9
9, 6, 3, 1, 8, 5
9, 3, 6, 8, 5, 1
9, 5, 6, 8, 3, 1
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
What is the time complexity of Build Heap operation. Build Heap is used to build a max(or min) binary heap from a given array. Build Heap is used in Heap Sort as a first step for sorting.
O(nLogn)
O(n^2)
O(Logn)
O(n)
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
1. BFS technique uses queue to find BFT (breadth first traversal)

2. DFS technique uses queue to find DFT (depth first traversal)

3. BFS technique uses stack to find BFT (breadth first traversal)

4. DFS technique uses stack to find DFT (depth first traversal)

Select correct ones

1,3
2,3
1,4
2,4
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Time complexity for BFS and DFS traversal, if the number of nodes in a graph are N and number of edges are M is?

Note: Adjacency list data structure is used while implementing DFS and BFS

O(N+M), O(N+M)
O(N), O(N+M)
O(N+M), O(M)
O(M), O(N)
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider a graph G(V,E), having V set of vertices and E set of edges.

Given two vertices in a graph s and t, which of the two traversals (BFS and DFS) can be used to find if there is path from s to t?

Only BFS
Only DFS
Both BFS and DFS
Neither BFS nor DFS
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider an undirected graph without selfloops of 7 nodes. The maximum number of edges in the graph will be _______.
21
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Given the following input (322, 334, 471, 679, 989, 171, 173, 199) and the hash function x mod 10, which of the following statements are true?

i. 679, 989, 199 hash to the same value

ii. 471, 171 has to the same value

iii. All elements hash to the same value

iv. Each element hashes to a different value

i only
ii only
i and ii only
iii or iv
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Delete the key sequence [6,5,4] from the below AVL tree. How many rotations are needed to make it a balanced AVL tree again? [MSQ]

1
2
3
4
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Consider a BST which is formed after inserting the elements 34, 27, 10 into an empty BST, in a given sequence. We want to convert this BST, in a given sequence.

We want to convert this BST into a balanced tree, whose balance factor () ranges from -1≤α≤1. Having these assumptions what will be the balance factor of the node 34 at initial step? If the tree is imbalance then which kind of imbalance is present in the tree?

Note: Consider height of child is 1.

2, LL imbalance
1, No imbalance
2, RL imbalance
-1, No imbalance
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the preorder traversal of a BST as follows:

Preorder: 67, 60, 55, 48, 58, 64, 80, 74, 84, 88, 90

What will be the post-order traversal of the above BST?

48 58 55 64 60 74 90 88 84 80 67
48 58 55 60 64 74 90 88 84 80 67
48 55 58 64 60 74 90 88 84 80 67
48 58 55 64 60 74 90 80 84 88 67
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Inserting integers [1,10,2,9,3,8,4,7,5,6] one by one in that order into an initially empty BST will result in a BST of height:
8
The height cannot be determined
10
9
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the inorder traversal of a BST as:

1, 2, 13, 14, 15, 16, 17, 18

and preorder traversal as:

15, 13, 1, 2, 14, 17, 16, 18

Which among the following is the correct BST for above traversals:

Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
In a binary tree, the number of internal nodes of degree 1 is 4, and the number of internal nodes of degree 2 is 8. The number of leaf nodes in the binary tree is
9
10
11
12
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the following Binary Search Tree

If we randomly search one of the keys present in the above BST, what would be the expected number of comparisons?

2.75
2.25
2.57
3.25
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following graph as shown in figure. If we apply DFS by considering a as starting vertex, which among the following is NOT the DFS possible?

abdec
abedc
acbde
adebc
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33