B-tree

B-tree
TypeTree (data structure)
Invented1970[1]
Invented byRudolf Bayer, Edward M. McCreight
Time complexity in big O notation
Operation Average Worst case
Search O(log n) O(log n)
Insert O(log n) O(log n)
Delete O(log n) O(log n)
Space complexity
Space O(n) O(n)

In computer science, a B-tree is a self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time. The B-tree generalizes the binary search tree, allowing for nodes with more than two children.[2]

By allowing more children under one node than a regular self-balancing binary search tree, the B-tree reduces the height of the tree, hence put the data in fewer separate blocks. This is especially important for trees stored in secondary storage (e.g. disk drives), as these systems have relatively high latency and work with relatively large blocks of data, hence its use in databases and file systems. This remains a major benefit when the tree is stored in memory, as modern computer systems rely on CPU caches heavily: compared to reading from the cache, reading from memory in the event of a cache miss also takes a long time.[3][4]

  1. ^ Bayer, R.; McCreight, E. (July 1970). "Organization and maintenance of large ordered indices" (PDF). Proceedings of the 1970 ACM SIGFIDET (Now SIGMOD) Workshop on Data Description, Access and Control - SIGFIDET '70. Boeing Scientific Research Laboratories. p. 107. doi:10.1145/1734663.1734671. S2CID 26930249.
  2. ^ Comer 1979.
  3. ^ "BTreeMap in std::collections - Rust". doc.rust-lang.org.
  4. ^ "abseil / Abseil Containers". abseil.io.

© MMXXIII Rich X Search. We shall prevail. All rights reserved. Rich X Search