Medium

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

CategoryData Structure
DifficultyMedium
Visit every nodeO(n)
Walk one pathO(height)
Worst heightO(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.