Binary Search Tree & Map
C++ · Templates · Recursion
Live
Insert a key
Binary search tree operations in motion
Compare keys to follow left or right branches. Insert a new leaf, find an existing key, iterate in ascending order, or create a map entry and set its value. The tree does not rebalance.
Insert
Find
Traverse
Map
Replay
Pause
01
Compare keys
02
Follow the branch
03
Insert a leaf
04
Keep keys ordered