Skip to content

sandboxcoder/PythonTreeNode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

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:

Level Order Traversal example

Below is the command you should use to execute this program:

python treenode.py

This 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

About

TreeNode Example Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages