This is your basic TreeNode implementation. I enjoy working with TreeNode data structures so figured it would be a good idea to put up a quick example. Below is a visualization of a binary tree:
Below is the command you should use to execute this program:
python treenode.pyThis script will build a tree and run the typical traversal techniques: inorder, postorder, preorder, & level order.
The Output from the Program is expected to be the following:
Depth First Traversals:
(a) Inorder (Left, Root, Right) : 4 5 6 8 10
(b) Preorder (Root, Left, Right) : 8 5 4 6 10
(c) Postorder (Left, Right, Root) : 4 6 5 10 8
Breadth First or Level Order Traversal : 8 5 10 4 6
