insert
Code:
So, a binary search tree is basically a data structure created by node?
and what exactly a node does?
does a single node always have 3 boxes? (the key, left and right?)
i have to write a program that will print out a tree...
* Each node should be printed on a separate line;
* the left subtree should be printed after the root;
* The right subtree should be printed before the root;
* The key value should be indented by 2h-2 spaces where h is the height of the node containing it. That is, the root should not be indented, the keys in its subtrees should be intended 2 spaces, the keys in their subtrees 4 spaces, and so on.
For example, the complete tree containing {1,2,3,4,5,6} would be printed like this:
6
5
4
3
2
1
I think i just dont understand the question...
and have a lot of unconcern....e.g., what is the height? aren't they just nodes?
can someone give me some hints on where should i start?
thx!!