B-tree over binary search tree?

Viewed 20

What is the advantage of a B-tree over binary search tree?

1 Answers

Here are some considerations:

  • B-trees store multiple keys in one node. This can be advantageous for disk storage as data will be less scattered at different locations. Wikipedia confirms it "is well suited for storage systems that read and write relatively large blocks of data".

  • B-trees and AVL trees are always balanced, which is not guaranteed for a plain binary search tree. A balanced tree ensures that retrieval, insertion and deletion all have a O(log) time complexity.

  • AVL rotations are more likely to happen compared to split/merge actions in B-trees, which in practice may make operations on B-trees run faster than on AVL trees (but with same time complexity).

Related