Binary Tree
Each node has up to two children. Visiting every node is linear. The cost of a root-to-leaf walk is the height, which can be n if the tree is a line.
Costs
| Category | Data Structure |
| Difficulty | Medium |
| Visit every node | O(n) |
| Walk one path | O(height) |
| Worst height | O(n) |
Questions
What is Binary Tree?
Each node has up to two children. Visiting every node is linear. The cost of a root-to-leaf walk is the height, which can be n if the tree is a line.
Where do I practice it?
DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.