Data Structures and Algorithms with Object-Oriented Design Patterns in C#
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.

   program21226
Program: BTree fields.




next up previous contents index

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