recategorized
3,338 views
1 votes
1 votes

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).

  1. 3, 14
  2. 3, 10
  3. 4, 14
  4. 4, 10
recategorized

3 Answers

2 votes
2 votes

Option (2) 3,10      

1 votes
1 votes

Answer is (2). 3,10

This is max heap and right of root is 10.

The depth is no. of edge from root to given node so depth is 3

Related questions

0 votes
0 votes
2 answers
1
Pooja Khatri asked Jul 13, 2018
8,888 views
A hash function h defined h(key)=key mod 7, with linear probing, is used to insert the keys 44, 45, 79, 55, 91, 18, 63 into a table indexed from 0 to 6. What will be the ...
0 votes
0 votes
2 answers
2
Pooja Khatri asked Jul 13, 2018
2,570 views
Which of the following algorithms solves the single-source shortest paths?Prim's algorithmFloys-Warshall algorithmJohnson's algorithmDijkstra's algorithm
0 votes
0 votes
8 answers
3
2 votes
2 votes
3 answers
4
Pooja Khatri asked Jul 13, 2018
17,102 views
The maximum number of comparisons needed to sort 9 items using radix sort is (assume each item is 5 digit octal number):4572360450