B-tree¶

A balanced tree optimized for accessing relatively slow memory elements (such as disk structures or database indexes); both branches and leaves are represented as lists (so that such a list can be read in a single pass for subsequent fast processing in RAM).

You can either write your own implementation or use Python's built-in sqlite3 database support, as this database is actually implemented using B-trees.