Data Structures and Algorithms
with Object-Oriented Design Patterns in C# |
Program defines a constructor that takes a single int argument M and creates an empty B-tree of order M. By default, the parent field is null.
The AttachSubtree method is used to attach a new subtree to a given node. The AttachSubtree routine takes an integer, i, and an M-way tree (which must be a B-tree instance), and makes it the subtree of the given node. Notice that this method also modifies the parent field in the attached node.