Medium

Binary Search Tree

A binary search tree keeps smaller keys in the left subtree and larger keys in the right. Search follows one path, so it tracks the height.

Costs

CategoryData Structure
DifficultyMedium
Search, insert, or deleteO(height)
Balanced heightO(log n)
Skewed heightO(n)

Questions

What is Binary Search Tree?

A binary search tree keeps smaller keys in the left subtree and larger keys in the right. Search follows one path, so it tracks the height.

Where do I practice it?

DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.