Notes

Search

Search IconIcon to open search

B-Tree Analysis

Last updated Dec 30, 2022

Bushiness and Invariants

Unlike in BSTs, where if you insert things in order the tree will be spindly, in B-Trees, if you insert things in order, the tree will be bushy no matter what.

We get two nice invariants:

These invariants guarentee a bushy tree.

Runtime Analysis

Let’s analyze the runtime of a contains operation.

This means our runtime will be $O((H+1)L)$ which is $O(HL)$.

However, we know that $H = \Theta(log(n))$, so $O(HL) = O(Llog(n))$ = $O(log(n))$. Note L is a constant, so we can drop it.