On the construction of weighted time-optimal B-trees

B-trees have been popular data structures since their definition. Their success is due to the fact that a B-tree containingn keys is “balanced” with a height ofO(logn). However, for a given set of elements and their access frequencies, one can construct many B-trees (possibly with different heights). The average access costs of these trees may vary significantly. An algorithm to construct a weighted time-optimal B-tree is presented. A weighted time-optimal B-tree is one in which the weighted access cost is minimized. A dynamic programming algorithm is used to construct a weighted time-optimal B-tree givenn elements and their weights. The algorithm runs in timeO(mn3 logn) and has a storage requirement ofO(mn2 logn) wherem is the order of the B-tree andn is the number of keys.