Skip to content
Advertisement

Tag: heap

Recursion under a heap class

I am trying to solve the following problem. “Define a recursive method named inOrderTraverse under the Heap class to perform inorder traversal over the nodes in the heap.” In the above problem, Do I convert the heap array to BST to run In order Traversal or Can I perform In order traversal over a heap array using recursion? if so

Heapsort Within a Given Range

I am trying to write a Heapsort method that only performs the sort within a given range passed into the method. The ranges low and high are passed in and these values correspond to values inside the heap, not indices of the heap. For example, the input array might be: 28 10 49 20 59 61 17 and if low

What’s wrong with my In Place Heap Sorting code

I’m working on a school assignment and the assignment was to make a heap sorting (In Place) program. Now the program works perfectly fine for arrays with under +- 20 elements, above that it occasionally messes up, however I can’t seem to find what’s wrong. The skeleton for the methods was already there so if you’re asking why certain parameters

Advertisement