i need to make a program that implements a heapsort using a binary tree. i understand the algorithm for how to do the sort, and i understand how it would be done using an array, but for my class i have to use a binary tree. The problem i am having is that nodes dont have a getParent, and although the finding a parents "index" in the tree is either n-1/2 or n-2/2, i dont understand how to get the index of the current node. for example in a binary tree that has 10 nodes, with the index at the …

Member Avatar
+0 forum 0

The End.