Skip to content

cmartinezal/Binary-Tree-Traversal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python-Binary-Tree-Traversal

Operations to traverse a binary tree

Traverse pre order tree

  1. Visit root node
  2. Visit all the nodes in the left subtree
  3. Visit all the nodes in the right subtree

Traverse in order tree

  1. Visit all the nodes in the left subtree
  2. Visit the root node
  3. Visit all the nodes in the right subtree

Traverse post order tree

  1. Visit all the nodes in the left subtree
  2. Visit all the nodes in the right subtree
  3. Visit the root node

Tree used for the example

Binary-Tree

Getting Started

Let's start to use this project.
There is a python file with the code and a Jupyter Notebook to visualize the code execution in your browser.

Prerequisites

Python 3 must be installed.

Installation

To execute the project open the terminal and go to the project folder. Then execute it with python:

python3 binary_tree.py

You can also use Jupyter Notebook to execute it in your browser or text editor directly.

About

Operations to traverse a binary tree

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published