* 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;
* Tthe 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.
Code:
For example, the complete tree containing {1,2,3,4,5,6} would be printed like this:
6
5
4
3
2
1
if you tilt the above diagram, you can see a tree with 4 being the root and 1,3,5 being the leaves....
should i start printing the largest number first?
but the values of keys in the tree does not need to be always 1 less than the previous one...so i can;t just search for the next key that is 1 less than the previous one...
confuesd...need some help, thx >.<