Why do insertion and removing operations in 2-3 tree always have complexity of O(logn), is there a mathematical proof?
𝑘
, in the worst case we need to split
𝑘 + 1
nodes (one at each of the 𝑘
levels plus the root).2-3 tree
containing 𝑛
keys with the maximum number of levels takes
the form of a binary tree where each internal node has one key and
two children.𝑛 = (2^(𝑘+1)) − 1
where 𝑘
is the number of the lowest
level.𝑘 + 1 = log(𝑛 + 1)
from which we see that the splits are in the worst case 𝑂 log 𝑛
.2-3 tree
takes at worst 𝑶 𝐥𝐨𝐠 𝒏
time.𝑶 𝐥𝐨𝐠 𝒏
time.