Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

BTreeMap

A map that keeps its keys in sorted order.

BTreeMap<K, V> is an ordered map built on a B-tree; operations take logarithmic time, iteration is in key order, and range queries are supported. Keys need Ord.

Loading interactive…

Examples

  • Inserting "Peru" and then "Japan" into a BTreeMap and printing it shows Japan first: keys come out in sorted order.

Read the full section →