Thread: Heap Tree
View Single Post
Old 04-27-2005, 08:06 PM   #1 (permalink)
TBNolan
Registered User
 
Join Date: Apr 2005
Posts: 2
TBNolan is on a distinguished road
Heap Tree

Hello all

i need to be practically spoon fed- i need to create a complete binary tree. each time i call this function add() i need to detect where the next empty spot in the tree is is using the two variables, count (the number of nodes in the tree) and height (the depth/number of rows to the tree). I also am passing a pointer to the root of the tree. I was planning on starting at the root and navigating, left to right, until i hit a leaf or a node with only one child.

any suggestions? maybe recursion? i just cant seem to wrap my head around the logic.

Thank you in advance
TBNolan is offline   Reply With Quote