Overview
This PR adds implementations of the three primary binary tree traversal algorithms:
- Inorder Traversal (Left, Root, Right)
- Preorder Traversal (Root, Left, Right)
- Postorder Traversal (Left, Right, Root)
These traversals are fundamental for understanding and manipulating binary trees.
Details
- Implemented using recursive approaches for clarity.
- Traversals return a list of visited node values.
- Supports trees with integer node values.
- Code is modular and easy to extend to iterative versions or non-binary trees.
Example
For the binary tree:
Overview
This PR adds implementations of the three primary binary tree traversal algorithms:
These traversals are fundamental for understanding and manipulating binary trees.
Details
Example
For the binary tree: