Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

scapegoat tree rebuilding...please help!

 
Thomas Dallaire
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm working on an assignment for school and I can't seem to get the rebuild function to work in this scapegoat tree.





Instead of sorting the array of nodes I'm trying to traverse the sub tree in order so that I'll end up with a sorted set. The next step would be to add the middle element of the array, then the middle element of the left half, and so on until all the elements from the array have been added to the tree.

So far that's not working though...could anyone offer me some advice as to how I should go about this?

Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic