Cover Data Structures and Algorithms with Object-Oriented Design Patterns in Java
next up previous contents index

Implementing B-Trees

Having already implemented the M-way search tree class, MWayTree, we can make use of much the existing code to implement a B-tree class. Program gif introduces the BTree class which extends the class MWayTree class introduced in Program gif With the exception of the two methods which modify the tree, insert and withdraw, the BTree class inherits all its functionality from the M-way tree class. Of course, the insert and withdraw methods need to be redefined in order to ensure that every time tree is modified the tree which results is a B-tree.

   program21098
Program: BTree fields.




next up previous contents index

Bruno Copyright © 1998 by Bruno R. Preiss, P.Eng. All rights reserved.