1.

The ascending heap property is ___________(a) A[Parent(i)] =A[i](b) A[Parent(i)] = A[i](d) A[Parent(i)] > 2 * A[i]My doubt is from Heap in portion Heap of Data Structures & Algorithms II have been asked this question in unit test.

Answer»

Right answer is (b) A[PARENT(i)] <= A[i]

Best EXPLANATION: The min heap is also known as ascending heap. Min heap of SIZE n is an almost complete binary tree of n nodes such that the element at each node is greater than or equal to the element at its parent node.



Discussion

No Comment Found

Related InterviewSolutions