im reading the section on binary search trees in the book c unleashed pages 458 and 459 have me confused. for those that don't have the book it describes a guessing game where the computer guesses a number between 1 and 15 and the user tells the computer if it guessed right or if the guess was too high or too low.

it then shows a binary search tree that demonstrates this. it stipulates that from the parent node the value of the child node to the left must be less than the parent node and the child node to the right must be greater than the parent.

it then gives the following two examples
quick question of a binary search tree child nodes-binary-tree-export-jpg

please excuse the bad drawings hopefully it has embedded them.

i can see that in each example all the values to the left of the top node are less than the top node and all the ones to the right are greater than the top node.

the question arises how does one decide what values go where and why would one do this the guessing game could easily be written with an if else statement in a loop.

coop