Q21➡| A priority queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order traversal of the heap is: 10, 8, 5, 3, 2. Two new elements 1 and 7 are inserted into the heap in that order. The level-order traversal of the heap after the insertion of the elements is:
i ➥ 10, 8, 7, 3, 2, 1, 5
ii ➥ 10, 8, 7, 2, 3, 1, 5
iii ➥ 10, 8, 7, 1, 2, 3, 5
iv ➥ 10, 8, 7, 5, 3, 2, 1
Q22➡| How many distinct binary search trees can be created out of 4 distinct keys?
i ➥ 5
ii ➥ 14
iii ➥ 24
iv ➥ 35
Q23➡| In a complete k-ary tree, every internal node has exactly k children or no child. The number of leaves in such a tree with n internal nodes is:
i ➥ nk
ii ➥ (n – 1) k+ 1
iii ➥ n( k – 1) + 1
iv ➥ n(k – 1)
Q24➡| In a binary max heap containing n numbers, the smallest element can be found in time
i ➥ O(n)
ii ➥ O(log n)
iii ➥ O(log log n)
iv ➥ O(1)
Q25➡| In a binary tree, the number of internal nodes of degree 1 is 5, and the number of internal nodes of degree 2 is 10. The number of leaf nodes in the binary tree is
21, i
22, ii
23, iii
24, ii
25, iii
21: i
22: iii
24: i
25: iii