Task 1 : Complete the implementation of the HeapSort function, following the exa
ID: 3903505 • Letter: T
Question
Task 1: Complete the implementation of the HeapSort function, following the example of TreeSort. The binary heap data structure does not have an iterator, but based on your knowledge of the BinaryHeap interface, you should find a suitable alternative for what needs to happen.
--------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------
Explanation / Answer
Just call the ++ operator function of BinarySearchTree class. I see that it is implementing inorder traversal over BST and inorder traversal should give you the numbers in ascending order. Call it element number of times.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.