btree_1_output.txt


--------demo tree--------

           5 
        /     \ 
       3       7 
      / \     / \ 
     2   4   6   8 
    / 
   1 

In the demo tree, for each node, the left sub-tree
contains values that are less than the node's value.
The right sub-tree contain values larger than
the node's value.

pre-order traversal : root -> left -> right
post-order traversal: right-> left -> root
in-order traversal  : left -> root -> right

pre-oder  : 5,3,2,1,4,7,6,8,
post-order: 1,2,4,3,6,8,7,5,
in-order  : 1,2,3,4,5,6,7,8,

As an exercise, create a tree that pre-order traversal
prints out the nodes in order (1,2,3,4,5,6,7,8,). How
about a post-order Traversal? How another traversal
method?

As you will see the order of the nodes and the tree
traversal are very much entwined. The design question
is how the data is comming in and how do we need to
access it. For example, is it worth the resources
(cpu cycles, memory, software development time, etc.)
to re-order the data for efficient access, etc.