Q: 1 A binary search tree is generated by inserting the following integers
47, 19, 5, 68, 23, 58, 39, 4, 6, 27, 50, 14
The number of nodes in the left sub-tree and right sub-tree of the root are _______ respectively.
(4,7)
(7,4)
(8,3)
(3,8)
[ Option C ]
A Binary Search Tree (BST) is a binary tree where:
The first element 47 becomes the root of the Binary Search Tree, and the remaining elements are inserted according to BST rules.
However, it is not always necessary to draw the complete tree, we can simply count the elements such that all values less than the root belong to the left subtree, and all values greater than the root belong to the right subtree.
Left Subtree (< 47):
Right Subtree (> 47):
Q: 2 Consider the following array elements A=[4, 1, 3, 2, 16, 9, 10, 14, 8, 7]. The number of interchanges that are necessary to convert the array elements into a max-heap is?
6
7
5
8
[ Option B ]
A Max-Heap is a complete binary tree in which every parent node is greater than or equal to its children.
So, if a parent has children, then:
Heaps are usually stored in an array.
For index i:
So, the given array A = [4, 1, 3, 2, 16, 9, 10, 14, 8, 7] is treated like this tree structure:

“Convert to Max-Heap” means rearranging the given array elements so that they satisfy the properties of a max-heap. In a max-heap, the largest element is always placed at the root (top), and every parent node has a value greater than or equal to its child nodes.
The Build-Max-Heap Algorithm uses a Bottom-Up approach to convert an array into a max-heap. Instead of starting from the root, it begins from the last non-leaf node and moves upward to the root, applying heapify at each step. This approach ensures that smaller subtrees are fixed first before handling their parent nodes.
Leaf Nodes are not processed because they already satisfy the heap property. Only internal nodes may violate the max-heap condition, so they are adjusted.
In an array representation of a max-heap (0-based indexing), the last non-leaf node is found using the formula: ⌊n/2⌋-1, where n is the total number of elements in the heap.
Step-by-Step Process:
Given Array A=[4, 1, 3, 2, 16, 9, 10, 14, 8, 7]
There are 10 elements, so the last non-leaf node is at index: ⌊10/2⌋-1 = 4. So we heapify from index 4 down to 0. Heapify from bottom to top.
Heapify at Index 4 : Value 16
Heapify at Index 3 : Value 2

Heapify at Index 2 : Value 3

Heapify at Index 1 : Value 1

Heapify at Index 0 : Value 4

The total number of interchanges necessary to convert the array into a Max-Heap is 7.
Q: 3 Consider the following statement:
S1: Ternary search is more efficient than binary search for finding an element in a sorted array.
S2: Worst case deletion and insertion in an AVL tree have same complexity.
S1 is correct, S2 is not
S2 is correct, S1 is not
Both are correct
Both are incorrect
[ Option B ]
Statement S1: Ternary search divides the array into three parts, while binary search divides it into two parts. Although ternary search reduces the search space into more parts, it requires more comparisons per step than binary search. As a result, binary search is generally more efficient for finding an element in a sorted array. Hence, S1 is incorrect.
Statement S2: In an AVL tree, both insertion and deletion operations may require rebalancing the tree. In the worst case, both operations take O(log n) time because the height of an AVL tree is always logarithmic. Hence, S2 is correct.
Q: 4 How many edges does a spanning tree of a graph with N vertices have?
N
N-1
N(N-1)/2
None of the above
[ Option B ]
A spanning tree is a subgraph of a connected graph that includes all the vertices but only enough edges to keep the graph connected without forming any cycles.
Q: 5 In a binary search tree, which subtree of a node contains elements that are greater than the node’s value?
Left Subtree
Right Subtree
Both Subtrees
None of the above
[ Option B ]
A Binary Search Tree (BST) is a special type of binary tree where the arrangement of elements follows a strict rule:
This property allows fast searching, because at each step, the tree decides whether to go left (for smaller values) or right (for larger values).
Q: 6 When a tree given in the diagram is traversed inorder, the order would be

a, b, d, h, e, i, j, c, f, g, k
h, d, i, j, e, b, f, k, g, c, a
h, d, b, i, e, j, a, f, c, k, g
h, d, b, e, i, j, a, f, c, k, g
[ Option C ]
In inorder traversal, nodes are visited in the order Left Subtree → Root → Right Subtree.
Left subtree of a (rooted at b):
Then visit root:
Right subtree of a (rooted at c):
Final inorder traversal:
h, d, b, i, e, j, a, f, c, k, g
Q: 7 Huffman coding algorithm works on the principle of
Randomization of Symbols
Key Based Portioning of Symbols
Hashing of Symbols
Frequencies of Input Symbols
[ Option D ]
The Huffman Coding Algorithm is a lossless data compression technique and a classic example of a Greedy Algorithm. It assigns variable-length binary codes to symbols based on their frequency of occurrence, where more frequent symbols get shorter codes and less frequent symbols get longer codes, reducing the overall size of the encoded data.
Since the algorithm generates codes according to the frequency of input symbols, Huffman coding works on the principle of symbol frequencies.
Q: 8 If we implement heap as maximum heap, adding a new node of value 15 to the left most node of right subtree, what value will be at leaf nodes of the right subtree of the heap?

15 and 1
25 and 1
3 and 1
2 and 3
[ Option A ]
Q: 9 The preorder traversal of a binary search tree is 15, 10, 12, 11, 20, 18, 16, 19. Which one of the following is the postorder traversal of the tree?
20, 19, 18, 16, 15, 12, 11, 10
11, 12, 10, 16, 19, 18, 20, 15
19, 16, 18, 20, 11, 12, 10, 15
None of the above
[ Option B ]
A Binary Search Tree (BST) is a special type of binary tree that is designed to allow fast searching, insertion, and deletion of data. In BST:
The preorder traversal sequence is given and in case of BST, the inorder traversal always sorts the tree nodes into ascending order.
Preorder : 15, 10, 12, 11, 20, 18, 16, 19
Inorder : 10, 11, 12, 15, 16, 18, 19, 20
WHEN PREORDER AND INORDER TRAVERSAL GIVEN:
So, the resultant BST is:
15
/ \
10 20
\ /
12 18
/ / \
11 16 19
Final Postorder traversal sequence is 11, 12, 10, 16, 19, 18, 20, 15
Q: 10 In a balanced binary tree, the height of two sub-trees of every node can not differ by more than
2
1
0
None of the above
[ Option B ]
A binary tree is a hierarchical data structure in which each node can have at most two children, called the left child and the right child.
Now, some binary trees can grow in an uneven manner. For example, all nodes may keep inserting to the left side only. This makes the tree skewed, and searching becomes slow. To avoid this, we use a balanced binary tree.
A Balanced Binary Tree is a special type of binary tree in which the height (depth) of the left and right subtrees of every node is kept nearly equal.
Height of left subtree and right subtree differ by 0 or 1 only.
This condition must hold at every node in the tree, not just the root.
So, in a balanced binary tree (AVL Tree), the difference between the heights of the left and right subtree of any node is allowed to be at most 1.
Q: 11 A binary search tree is used to locate the number 53. Which of the following probe sequences are not possible
(i) 27,87,37,76,28,53
(ii) 12,13,60,50,70,53
(iii) 20,75,41,58,47,53
(iv) 71,62,24,27,50,53
Only (i)
Only (i) and (iii)
Only (ii) and (iv)
Only (i) and (ii)
[ Option D ]
A Binary Search Tree (BST) is a tree where:
The given sequences like 27, 87, 37, 76, 28, 53 represent the path followed while searching the key 53 in a BST. That means:
While searching in a BST:
Every step creates a valid range (Minimum, Maximum), Initially: (-∞, +∞). The next node in the sequence must lie within this range.
Rule:
This concept comes from the basic property of a Binary Search Tree (BST), where all elements on the left side of a node are smaller, and all elements on the right side are greater.
While searching for a value (like 53), we move left or right based on comparison, and this movement automatically creates restrictions.
When we move to the right of a node, it means the searched value is greater than that node. So, all future nodes we visit must also be greater than that value. In this way, the Minimum Limit (Lower Bound) gets updated.
Similarly, when we move to the left of a node, it means the searched value is smaller than that node. So, all future nodes must be smaller than that value. This updates the Maximum Limit (Upper Bound).
For example, if we first move right from 27 and then left from 87, the valid range becomes (27, 87). Now, every next node must lie within this range, otherwise, the sequence becomes invalid.
Now check given sequence one by one.
(i) 27 → 87 → 37 → 76 → 28 → 53
| Step | Node | Comparison & Movement | Valid Range |
|---|---|---|---|
| 1 | 27 | 53>27 → Right | (27, ∞) |
| 2 | 87 | 53<87 → Left | (27, 87) |
| 3 | 37 | 53>37 → Right | (37, 87) |
| 4 | 76 | 53<76 → Left | (37, 76) |
| 5 | 28 | 28<37 (Out of Range) | Not in Range |
Problem: 28 is not in (37, 76). Therefore, this sequence is NOT possible.
(ii) 12 → 13 → 60 → 50 → 70 → 53
| Step | Node | Comparison & Movement | Valid Range |
|---|---|---|---|
| 1 | 12 | 53>12 → Right | (12, ∞) |
| 2 | 13 | 53>13 → Right | (13, ∞) |
| 3 | 60 | 53<60 → Left | (13, 60) |
| 4 | 50 | 53>50 → Right | (50, 60) |
| 5 | 70 | 70>60 (Out of Range) | Not in Range |
Problem: 70 is not in (50, 60). Therefore, this sequence is NOT possible.
(iii) 20 → 75 → 41 → 58 → 47 → 53
| Step | Node | Comparison & Movement | Valid Range |
|---|---|---|---|
| 1 | 20 | 53>20 → Right | (20, ∞) |
| 2 | 75 | 53<75 → Left | (20, 75) |
| 3 | 41 | 53>41 → Right | (41, 75) |
| 4 | 58 | 53<58 → Left | (41, 58) |
| 5 | 47 | 53>47 → Right | (47, 58) |
| 6 | 53 | 47<53<58 | Valid |
(iv) 71 → 62 → 24 → 27 → 50 → 53
| Step | Node | Comparison & Movement | Valid Range |
|---|---|---|---|
| 1 | 71 | 53<71 → Left | (-∞, 71) |
| 2 | 62 | 53<62 → Left | (-∞, 62) |
| 3 | 24 | 53>24 → Right | (24, 62) |
| 4 | 27 | 53>27 → Right | (27, 62) |
| 5 | 50 | 53>50 → Right | (50, 62) |
| 6 | 53 | 50<53<62 | Valid |

Q: 12 Which one of the following techniques is not used in the binary tree?
Randomized traversal
Preorder traversal
Postorder traversal
More than one of the above
[ Option A ]
A binary tree is commonly traversed using three standard tree traversal techniques:
These methods are systematic and widely used in all tree-related algorithms.
Q: 13 The preorder traversal of a Binary Search Tree (BST) is 100, 50, 20, 30, 60, 55, 150, 130, 140, 180, 170. What would be its postorder traversal?
20, 30, 55, 60, 50, 130, 140, 180, 170, 150, 100
20, 30, 55, 60, 50, 140, 130, 180, 170, 150, 100
30, 20, 55, 60, 50, 140, 130, 170, 180, 150, 100
30, 20, 60, 55, 50, 130, 140, 180, 170, 150, 100
[ Option C ]
As we know, inorder traversal of BST is in sorted order. So,
Inorder Traversal : 20, 30, 50, 55, 60, 100, 130, 140, 150, 170, 180
Preorder Traversal : 100, 50, 20, 30, 60, 55, 150, 130, 140, 180, 170
With Inorder and Preorder, unique BST can be determined.

Using the above constructed BST, the postorder traversal sequence is:
Postorder Traversal : 30, 20, 55, 60, 50, 140, 130, 170, 180, 150, 100
Q: 14 Consider the array A = <4, 1, 3, 2, 16, 9, 10, 14, 8, 7>. After building heap from the array A, the depth of the heap and the right child of max—heap are ____ and ____ respectively. (Root is at level 0).
3, 14
3, 10
4, 14
4, 10
[ Option B ]
A Max-Heap is a complete binary tree in which every parent node is greater than or equal to its children. When a heap is constructed from an array (Using Heapify), the largest element becomes the root, and smaller elements move toward the lower levels.
After inserting all the nodes in the max-heap there are total 3-level and right child of root node is 10.

Q: 15 A complete n-ary tree is one in which each node has n children or no children. Let I be the number of internal nodes and L be the number of leaves in a complete n-ary tree. If L=41 and I=10, what is the value of n?
3
4
5
6
[ Option C ]
In a complete (full) n-ary tree, every internal node has exactly n children. A standard relation between internal nodes (I) and leaves (L) is: L = (n-1)*I+1
This formula comes from the fact that each internal node contributes n children, but overlaps create this final relation.
Given:
L = 41, I = 10
L = (n-1)*I+1
41 = (n-1)*10+1
41 = 10n-10+1
10n=41+10-1
10n=50
n=50/10
n=5
Q: 16 Let QUSVPTR is in-order traversal and UVSQTRP is post-order traversal of a binary tree T. Which of the following is pre-order traversal of the binary tree T?
PUQSVRT
UVRTPQS
SQPRTVU
PQSUVRT
[ Option D ]
Q: 17 Which of the following options is not true about the binary search tree?
The value of the left child should be less than the root node.
The value of the right child should be greater than the root node.
The left and right subtrees should also be a binary search tree.
None of the above
[ Option D ]
A Binary Search Tree (BST) is a binary tree where nodes follow a strict ordering rule for efficient searching, insertion, and deletion. Each node has at most two children.
BST Rule:
Q: 18 How many edges are possible in a forest with ‘n’ vertices and ‘k’ trees?
n-k+1
n+k-1
n+k
n-k
[ Option D ]
A forest is an acyclic undirected graph, that is, a collection of disjoint trees. Each tree with m vertices has m-1 edges, so the total edges in the forest are:
n1 - 1 + n2 - 1 + ... + nk - 1 = (n1 + n2 + ... + nk) - k = n-k
So the number of edges is n-k.
Q: 19 Let a BST is constructed by inputting an ordered list [33, 45, 2, 91, 47, 95] from left to right. Which of the following pair of elements will be on the last level of the BST?
47, 91
47, 95
2, 95
91, 95
[ Option B ]
33
/
2 45
91
/
47 95
Q: 20 Which of the following graphs are trees?

(A) and (B) only
(A), (B) and (D) only
(A) and (D) only
(A), (B), (C) and (D) only
[ Option A ]
Here,
(a) and (b) are trees.
(c) is not a tree because adeb form a graph
(d) It is not hierarchical so that is why not a tree.

Q: 21 Which of the following TREE traversal technique is NOT based on Depth First Search (DFS)?
Level Order Traversal
Preorder Traversal
Inorder Traversal
Postorder Traversal
[ Option A ]
The Level Order Traversal also known as Breadth First Search (BFS) while other three are DFS.
Q: 22 Which of the following algorithms uses the greedy approach to find a Minimum Spanning Tree (MST)?
Bellman-Ford Algorithm
Kruskal’s and Prim’s Algorithm
Floyd-Warshall Algorithm
Dijkstra’s Algorithm
[ Option B ]
A Minimum Spanning Tree (MST) is a subset of the edges of a connected, weighted graph that:
Algorithms for MST:
Bonus:
Q: 23 What is true about the height h of a B-tree with n keys (n ≥ 1) and minimum degree t ≥ 2 ?
h ≤ logt(n) + 1
h ≤ logt((n + 1) / 2)
h ≤ logt(n-1)
h ≤ log2(n)
[ Option B ]
Q: 24 How many distinct binary search trees can be created out of 4 distinct keys?
8
24
14
None of the above
[ Option C ]
When number of node N is given then how many total numbers of possible binary trees can be drawn. This can be calculated using Catalan number. Cn=(2n)!/(n+1)!n!, where, n is number of nodes.
When n=4.
C4 = (2*4)!/(4+1)!*4!
C4 = 8!/5!*4!
C4 = 8*7*6*5!/5!*4*3*2*1
C4 = 336/24
C4 = 14
Q: 25 The pre-order traversal of a binary search tree is 22, 9, 8, 1, 6, 19, 18, 17, 20, 23, 29, 33. Then the post-order traversal of this tree is
1,6,8,9,17,18,19,22,23,29,33,20
1,6,8,17,9,22,23,18,19,33,29,20
6,1,8,20,18,17,19,9,29,22,33,22
6,1,8,17,18,20,19,9,33,29,23,22
[ Option D ]
A Binary Search Tree (BST) is a special type of binary tree that is designed to allow fast searching, insertion, and deletion of data. In BST:
The preorder traversal sequence is given and in case of BST, the inorder traversal always sorts the tree nodes into ascending order.
Preorder : 22, 9, 8, 1, 6, 19, 18, 17, 20, 23, 29, 33
Inorder : 1, 6, 8, 9, 17, 18, 19, 20, 22, 23, 29, 33
WHEN PREORDER AND INORDER TRAVERSAL GIVEN:
So, the resultant BST is:

Final Postorder traversal sequence is 6,1,8,17,18,20,19,9,33,29,23,22
Q: 26 Which algorithm is used to compute minimum spanning tree of a graph?
Kruskal’s Algorithm
Binary Search Algorithm
Depth First Search
Breadth First Search
[ Option A ]
A Minimum Spanning Tree (MST) is a subset of edges in a connected weighted graph that connects all vertices with the minimum total edge weight and without forming any cycles.
Kruskal’s Algorithm is a well-known greedy algorithm that builds the MST by selecting the smallest weight edges one by one, ensuring no cycle is formed.
Q: 27 Which of the following data structures has the fastest insertion procedure?
Binary Search Tree
Ordered Linked List
Heap
Ordered Array
[ Option C ]
Insertion performance depends on how much rearrangement or shifting is required after adding a new element.
A heap is a complete binary tree (usually implemented as an array) where insertion is done by placing the element at the end and then adjusting it using heapify (upward movement). This takes O(log n) time and involves minimal shifting compared to other structures.
| Structure | Insertion Time |
|---|---|
| Heap | O(log n) |
| BST | O(n) |
| Ordered Linked List | O(n) |
| Ordered Array | O(n) |
Ordered Array:
Ordered Linked List:
Binary Search Tree (BST):
Heap:
Q: 28 In which order should the number 27, 13, 1, 4, 15, 20, 9 be inserted into an empty binary search tree to get the same inorder and preorder traversal?
1, 4, 9, 13, 15, 20, 27
27, 20, 15, 13, 9, 4, 1
4, 13, 20, 27, 1, 15, 9
13, 27, 1, 4, 15, 20, 9
[ Option A ]
In a Binary Search Tree (BST), different traversals follow specific patterns:
For both inorder and preorder to be the same, the BST must have a special structure:
In option (a), the insertion order is 1 → 4 → 9 → 13 → 15 → 20 → 27, which creates a right-skewed BST where there are no left children, and as a result, both inorder and preorder traversals become identical, i.e., 1, 4, 9, 13, 15, 20, 27.
Note:
A Right-Skewed Binary Search Tree is a special type of BST in which every node has only a right child and no left child. This structure looks like a straight line leaning towards the right side.
In such a tree, elements are inserted in increasing order, so each new element becomes the right child of the previous node. Because there are no left children, both Inorder and Preorder traversals produce the same sequence.
Q: 29 Which one of the following techniques is not used in the binary tree?
Preorder traversal
Inorder traversal
Postorder traversal
None of the above
[ Option D ]
A binary tree is a hierarchical data structure in which each node has at most two children. To process or visit all nodes of a binary tree, several traversal techniques are used:
All three are standard and commonly used techniques for binary tree traversal.
Q: 30 Suppose you want to do a level order traversal in a rooted tree. Which of the following will you do?
Starting from the root, perform Linear Search
Starting from the root, perform Binary Search
Starting from the root, perform Breadth First Search
Starting from the root, perform Depth First Search
[ Option C ]
Level Order Traversal means visiting nodes level by level from top to bottom, starting from the root. In this traversal, all nodes at one level are visited before moving to the next level.
This behavior is exactly followed by Breadth First Search (BFS). BFS uses a Queue to process nodes level-wise, making it the correct method for level order traversal.
Q: 31 Consider the following array
| 4 | 1 | 3 | 2 | 16 | 9 | 10 | 14 | 8 | 7 |
|---|
What will be the last element of the max—heap formed from the above array?
4
9
1
2
[ Option D ]
A max-heap is a complete binary tree in which every parent node is greater than or equal to its children. When a heap is constructed from an array (Using Heapify), the largest element becomes the root, and smaller elements move toward the lower levels.
After inserting all the nodes in the max-heap, the last element is 2.
Q: 32 Consider the given binary search tree, if the root node will be deleted, the new root can be-

43 or 48
63 or 81
48 or 59
30 or 63
[ Option C ]
Q: 33 What will be post order traversal of a binary Tree T, if preorder and inorder traversals of T are given by ABCDEF and BADCFE respectively?
BDFECA
BCFDEA
BFDECA
BEFDCA
[ Option A ]
In a tree data structure, there are three primary types of traversal sequences used to visit all the nodes systematically: Preorder, Inorder, and Postorder traversal.
So,
(1) Preorder Traversal: Root → Left → Right
(2) Inorder Traversal: Left → Root → Right
(3) Postorder Traversal: Left → Right → Root
The preorder traversal of the tree is ABCDEF, which means the root of the tree is A. Looking at the inorder traversal BADCFE, we see that A splits the tree into a left subtree (B) and a right subtree (DCFE). Thus, B is the left child of A, and the rest of the nodes (DCFE) belong to the right subtree.
In the right subtree, the preorder sequence is CDEF, so the root here is C. From the inorder sequence DCFE, the node C splits the subtree into D on the left and FE on the right. For the FE part, preorder tells us the root is E, and inorder (FE) shows that F is on the left of E. This gives the right subtree structure: C has left child D and right child E, with E having left child F.
Now, constructing the postorder traversal: start with the left subtree of A which is B, then the right subtree rooted at C. For C, its left subtree gives D, and its right subtree rooted at E gives F followed by E. After these, we add the root C. Finally, we append the overall root A. Putting this together, the Postorder is B D F E C A.
Q: 34 Which best describes how Kruskal’s algorithm constructs a Minimum Spanning Tree (MST)?
Adds edges in increasing order of weight while avoiding cycles.
Adds the smallest edge that connects a visited vertex to an unvisited one.
Grows the MST by adding the maximum weight edge from a starting node.
Selects a root and grows the MST by always choosing the closest neighbour.
[ Option A ]
Kruskal’s algorithm is a greedy algorithm used to find the Minimum Spanning Tree (MST) of a connected, weighted graph. It works by sorting all the edges of the graph in non-decreasing order of their weights. Then, it iteratively adds the smallest edge to the MST, provided that adding the edge does not create a cycle in the growing tree.
The algorithm continues until the MST has exactly V−1 edges, where V is the number of vertices.
Unlike Prim’s algorithm, which grows the MST from a starting vertex, Kruskal’s algorithm builds the MST by focusing on edges first, ensuring the final tree has the minimum total weight.
Must Know:
Non-decreasing order of their weight means the edges are arranged from smallest weight to largest weight, but equal weights are allowed to appear next to each other. For example, if the edge weights are [6, 2, 9, 4, 2], then sorted in non-decreasing order they become [2, 2, 4, 6, 9].
Q: 35 The numbers 1, 2, ………….n are inserted in a binary search tree in the same order. If its right sub-tree has ‘p’ nodes then the first number to be inserted in the tree must be
p-n
n-p+1
n+p
n-p
[ Option D ]
When the numbers 1, 2, …, n are inserted into a Binary Search Tree in increasing order, the first inserted element becomes the root (k). In a BST, all elements greater than the root are placed in the right subtree, while smaller elements go to the left subtree.
The number of nodes in the right subtree will be the count of elements greater than the root, which is given by n-k. According to the question, the right subtree contains p nodes, so we can write the relation as n-k = p.
Solving this equation, we get k = n-p, which represents the first inserted number (root). Hence, the required answer is n-p.
Q: 36 A list of integers is read in, one at a time and a binary search tree is constructed. Next the tree is traversed and the integers are printed. Which traversal would result in a print out which is same as the original order of the list of integers?
Preorder
Postorder
Inorder
None of these
[ Option D ]
In a Binary Search Tree (BST), elements are inserted one by one, and the structure of the tree depends on the insertion order.
However, once the tree is constructed, the traversal order depends on the structure of the tree, not on the original sequence of insertion.
Inorder traversal always gives a sorted sequence, preorder and postorder depend on the tree shape, and none of these traversals can consistently reproduce the original list. Therefore, no traversal guarantees the same order as the input list in all cases.
Q: 37 Find the child node/nodes of node 17 in the array representation of the binary tree given below.

18
39
12
21
[ Option A ]
In an array representation of a Binary Tree (1-Based Indexing), the position of children is determined using formulas:
In 0-Based Indexing:
Where i is index of parent node.
Here, node 17 is at index 5.
So,
Thus, node 17 has only one child, which is 18.
Q: 38 A Binary Search Tree whose left subtree and right subtree differ in height by at most one unit is called
Complete Binary Tree
AVL Tree
Lemma Tree
Red-Black Tree
[ Option B ]
A Binary Search Tree (BST) can become unbalanced, which increases search time. To solve this, self-balancing trees are used.
An AVL (Adelson-Velsky and Landis) Tree is a special type of BST where the difference between the heights of the left and right subtrees, called balance factor, is at most 1 for every node.
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.