Binary search trees are well known as a method for organizing information which supports efficient insert, delete, and search operations. Considerable attention has been given recently to maintaining the balance in binary search trees. A recent algorithm has been developed which maintains a balanced tree by displacing keys, when necessary, using an in-order shift algorithm (ISA). This tree has minimum internal path length, and we call such a tree an ISA tree. In this paper we investigate the cost of maintaining an ISA tree. We use fringe analysis to investigate the behavior of such trees. Several theorems and lemmas are presented describing the nature of ISA trees and how they grow and maintain minimum internal path length. We use this anaylsis to determine the expected number of times an in-order shift will be required in the construction of an ISA tree. Furthermore, we define the cost of each possible in-order shift operation, and determine empirically the expected cost to construct and maintain an ISA tree. We present some interesting patterns that emerge in the construction of these trees from one level to another. We conclude that most of the time main-tainance of an ISA tree is quite inexpensive. However, in certain instances it can be quite expensive. The cost can be justified, however, if searching is the predominant activity, and inserting is relatively infrequent in comparison. Permission to copy without fee all or part of this material is granted provided that the copies are not made or distributed for direct commercial advantage, the ACM copyright notice and the rifle of the publication and its date appear, and notice is given that copying is by permission of the Association for Computing Machinery. To copy otherwise, or to republish, requires a fee and/or specific permission.
[1]
Mark R. Brown,et al.
A Partial Analysis of Random Height-Balanced Trees
,
1979,
SIAM J. Comput..
[2]
Quentin F. Stout,et al.
Tree rebalancing in optimal time and space
,
1986,
CACM.
[3]
Gaston H. Gonnet,et al.
Balancing binary trees by internal path reduction
,
1983,
CACM.
[4]
Thomas E. Gerasch,et al.
An insertion algorithm for a minimal internal path length binary search tree
,
1988,
CACM.
[5]
Edward M. Reingold,et al.
Binary Search Trees of Bounded Balance
,
1973,
SIAM J. Comput..
[6]
S. Sitharama Iyengar,et al.
Efficient algorithms to globally balance a binary search tree
,
1984,
CACM.