Data Structure Test Set 9
Q41➡ | Consider a max heap, represented by the array: 40, 30, 20, 10, 15, 16, 17, 8, 4. Now consider that a value 35 is inserted into this heap. After insertion, the new heap is |
i ➥ 40, 30, 20, 10, 15, 16, 17, 8, 4, 35 |
ii ➥ 40, 35, 20, 10, 30, 16, 17, 8, 4, 15 |
iii ➥ 40, 30, 20, 10, 35, 16, 17, 8, 4, 15 |
iv ➥ 40, 35, 20, 10, 15, 16, 17, 8, 4, 30 |
Q42➡ | While inserting the elements 71, 65, 84, 69, 67, 83 in an empty binary search tree (BST) in the sequence shown, the element in the lowest level is |
i ➥ 65 |
ii ➥ 67 |
iii ➥ 69 |
iv ➥ 83 |
Q43➡ | Consider the following array of elements. ⌌89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100⌍. The minimum number of interchanges needed to convert it into a max-heap is |
i ➥ 4 |
ii ➥ 5 |
iii ➥ 2 |
iv ➥ 3 |
Q44➡ | Let T be a binary search tree with 15 nodes. The minimum and maximum possible heights of T are: Note: The height of a tree with a single node is 0. |
i ➥ 4 and 15 respectively |
ii ➥ 3 and 14 respectively |
iii ➥ 4 and 14 respectively |
iv ➥ 3 and 15 respectively |
Q45➡ | The pre-order traversal of a binary search tree is given by 12, 8, 6, 2, 7, 9, 10, 16, 15, 19, 17, 20. Then the post-order traversal of this tree is: |
i ➥ 2, 6, 7, 8, 9, 10, 12, 15, 16, 17, 19, 20 |
ii ➥ 2, 7, 6, 10, 9, 8, 15, 17, 20, 19, 16, 12 |
iii ➥ 7, 2, 6, 8, 9, 10, 20, 17, 19, 15, 16, 12 |
iv ➥ 7, 6, 2, 10, 9, 8, 15, 16, 17, 20, 19, 12 |
Weekly Test GATE/NTA NET CSA
41, iii
42, iii
43, iii
44, ii
45, ii
41: ii
42: ii
43: iv
44: iii
45: ii