Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

What is this code about:

  • This Python program demonstrates how to perform a post-order traversal of a binary tree. In post-order traversal, the nodes are recursively visited in the following order:
  1. Left subtree
  2. Right subtree
  3. Root node

Features:

  • Implements a basic binary tree structure using the Node class.
  • Traverses the tree in post-order and prints the node data.

Binary Tree Construction: The binary tree is manually constructed in the following structure Siblings /
Wanja Akama / \ /
Valerie Moraa Okeya Tom

Post-Order Traversal:

  • This function visits nides in the post-order sequence
  • Traverses the left subtree.
  • Traverses the right subtree.
  • Visits the root node.

How to Run the Program:

  • python post_order_traversal.py

Example Output: Valerie Moraa Wanja Okeya Tom Akama Siblings

Concepts Covered:

  • Binary tree structure.
  • Recursive traversal.
  • Post-order traversal algorithm.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages