Algorithms

Red-black tree

A self-balancing binary search tree, less strict than the AVL: it rotates less when inserting and deleting, in exchange for ending up a bit taller.

Example

Java turns a HashMap bucket with 8 or more elements into a red-black tree: searching there goes from 8 steps to about 3.

Lessons that use it

More algorithms terms

All terms →

Arki, the beaver mascot

Your next interview starts with 5 minutes today.

Free on iOS and Android. Start from zero, no account needed.