Thread: pointer help
View Single Post
Old Mar 31st, 2006, 2:58 PM   #30
cwl157
Professional Programmer
 
Join Date: Feb 2005
Posts: 343
Rep Power: 4 cwl157 is on a distinguished road
i thought calling it recursively is the easiest way to do it. The number is supposed to be inserted in the next available spot going left to right. So the number the user entered is supposed to be added to the next available spot and then you compare that node with all the nodes before it and if its smaller than the parent node you swap the values because the lowest value has to be the root. I am checking when they are null because when one is null thats where the new value goes or something like that? Like i get the idea of inserting and swapping and stuff on paper with a picture of a tree and stuff but i have no clue how it should be programmed or anything.
cwl157 is offline   Reply With Quote