Tree Traversal
Preorder visits a node before its children, inorder between them, and postorder after them. Each visits every node once.
Costs
| Category | Algorithm |
| Difficulty | Medium |
| Time | O(n) |
| Stack or recursion | O(height) |
| Inorder on a BST | keys come out sorted |
Questions
What is Tree Traversal?
Preorder visits a node before its children, inorder between them, and postorder after them. Each visits every node once.
Where do I practice it?
DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.