Monday, October 24, 2011

Binary Tree Code

Building tree with root value 25
=================================
  Inserted 11 to left of node 25
  Inserted 15 to right of node 11
  Inserted 16 to right of node 15
  Inserted 23 to right of node 16
  Inserted 79 to right of node 25

preorder traversing
=================================
Traversed 25
Traversed 11
Traversed 15
Traversed 16
Traversed 23
Traversed 79

postorder traversing
=================================
Traversed 23
Traversed 16
Traversed 15
Traversed 11
Traversed 79
Traversed 25

inorder traversing
=================================
Traversed 11
Traversed 15
Traversed 16
Traversed 23
Traversed 25
Traversed 79
http://www.roseindia.net/java/java-get-example/java-binary-tree-code.shtml

No comments:

Post a Comment