Binary Heaps questions

Q37

GATE CS 2016 CS-1Tree Data StructuresMCQ2 marks−2/3 if wrong
An operator delete(i) for a binary heap data structure is to be designed to delete the item in the i-th node. Assume that the heap is implemented in an array and i refers to the i-th index of the array. If the heap tree has depth d (number of edges on the path from the root to the farthest leaf), then what is the time complexity to re-fix the heap efficiently after the removal of the element?
Show answer without attempting

Answer: B

Q34

GATE CS 2016 CS-2Tree Data StructuresNAT2 marks
A complete binary min-heap is made by including each integer in [1,1023][1, 1023] exactly once. The depth of a node in the heap is the length of the path from the root of the heap to that node. Thus, the root is at depth 0. The maximum depth at which integer 9 can appear is _________.
Show answer without attempting

Answer: 8.0

0/20 correct0 marks

Related topics in Tree Data Structures