Examveda

Given an array of element 5, 7, 9, 1, 3, 10, 8, 4. Which of the following are the correct sequences of elements after inserting all the elements in a min-heap?

A. 1,3,4,5,7,8,9,10

B. 1,4,3,9,8,5,7,10

C. 1,3,4,5,8,7,9,10

D. 1,3,7,4,8,5,9,10

Answer: Option A


This Question Belongs to Data Structure >> Heaps

Join The Discussion

Related Questions on Heaps

Which of the following is true for a min-heap?

A. The root node is the smallest element, and every parent node is smaller than its children.

B. The root node is the largest element, and every parent node is larger than its children.

C. All nodes are arranged in a complete binary tree.

D. The tree is always balanced.