} [/code]

Answer: C
Explanation: The condition under while condition is wrong for a (min) binary heap The correct condition should be while(i!=0 && harr[parent(i)] > harr). Otherwise the constructed heap will be a max-binary heap.
 

Tìm kiếm

Back
Top