B-Tree

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. It is optimized for systems that read and write large blocks of data.

B-Tree Properties:

  • All leaves are at the same level
  • A non-leaf node with k children contains k-1 keys
  • Each node (except root) has at least t-1 keys and at most 2t-1 keys
  • All nodes (including root) may have at most 2t children

Time Complexity:

  • Search: O(log n)
  • Insert: O(log n)
  • Delete: O(log n)

Use the controls above to perform operations on the B-tree. Notice how the tree maintains its balance by splitting and merging nodes.