1.

Theleaf node for a heap of height h will be at which position.(a) h(b) h-1(c) h or h-1(d) h-2This key question is from Weak Heap in portion Heap of Data Structures & Algorithms II had been asked this question during an interview.

Answer»

Right OPTION is (c) H or h-1

For explanation: A complete binary tree is ALSO a HEAP so by the PROPERTY of binary tree the leaf nodes will be must at height h or h-1.



Discussion

No Comment Found

Related InterviewSolutions