engineering recuitment GATE CSE 2023-24 Test Series Programming and Data Structure Binary Heap Binary Search Tree
Consider a min heap, represented by the array:
|
Array index |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
|
Value |
9 |
11 |
26 |
24 |
29 |
28 |
30 |
33 |
27 |
31 |
35 |
34 |
Now consider that a value 12 is inserted into this heap. Find the minimum number of interchanges needed to convert it into min-heap?
1
1
2
2
3
3
4
4