An efficient method and apparatus for storing and retrieving memory ranges
is disclosed. A key range that is stored or to be stored is associated
with a node in the tree hierarchy encompassing the entire memory address
space. All previously stored ranges are listed or otherwise associated
with each node, and all possible nodes that may contain ranges that
overlap the key range, regardless of starting or ending locations or
range length, are found. Partitions are developed in the tree structure
of the available address space and the width of the key range (w), the
widths of the partitions (d), and the range of offsets in the starting
location of the key range with respect to a partition (o) are used to
develop a formula that finds a partition suitable for storing the key
range. Hashing and dynamic tree building may be used.