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

Implementation

Program gif declares the TwoWayMergeSorter class. The TwoWayMergeSorter class extends the AbstractSorter class defined in Program gif. A single field, tempArray, is declared. This field is an array of ComparableObjects. Since merge operations cannot be done in place, a second, temporary array is needed. The tempArray field keeps track of that array.

   program44254
Program: TwoWayMergeSorter fields.


next up previous contents index

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