Home | Projects | Notes > Data Structures & Algorithms > Tree Traversal (Pre-Order, In-Order, Post-Order)

Tree Traversal (Pre-Order, In-Order, Post-Order)

 

Tree Traversal

Pre-Order Traversal (n-l-r): T = O(n), S = (h)

In-Order Traversal (l-n-r): T = O(n), S = (h)

Post-Order Traversal (l-r-n): T = O(n), S = (h)

Code (C++)