B-trees are preferred to binary trees in databases because
View worked solution
Answer: B
The primary bottleneck in database systems is disk I/O (Input/Output). Accessing data from a secondary storage device (disk) is several orders of magnitude slower than accessing main memory (RAM).
To minimize the number of disk accesses, we need an indexing structure with a very small height:
- Binary Search Trees (BSTs): Have a fan-out (branching factor) of at most . For records, the height of a balanced BST is . Searching a record requires traversing many levels, resulting in a high number of disk reads.
- -Trees: Have a very high fan-out (typically in the hundreds), because each node is designed to fit exactly into one disk block. The height of a -tree is . For example, if and , the height is only , meaning we need at most 3 disk accesses to find any record.
Thus, because disk access is much slower than memory access, -trees are preferred to minimize disk reads by keeping the tree height extremely low.
Free practice · Your answers on this page are not saved.
