Unit 12 of 12 · Binary Search Tree (BST)

Popular Use

1 min Updated Jul 2026

Databases and file systems. Indexes are often built on tree structures so records can be looked up, inserted, and range-scanned without scanning the whole table.

Autocomplete and spell-check. Ordered tree structures let software quickly find words that come “near” a given prefix, instead of comparing against every word in the dictionary.

Priority queues and scheduling. Some priority queue implementations use tree-based structures to keep the smallest or largest item quickly accessible while still supporting fast inserts.

Maintaining sorted data. Any time a program needs a collection that stays sorted *while* items are being added and removed, a BST (or one of its balanced variants) is a natural fit — much cheaper than re-sorting a list after every change.