next up previous contents
Next: The CHAR_DLLIST Implementation Details: Up: The CHAR_SLLIST Implementation Details: Previous: The Protected Search Elements:

The MergeSort Agent:

All of the functions to implement the mergesort algorithm are implemented in the split, merge and mergesort agents in the SL_CELL class. We can utilize this capability with a call to the mergesort agent for the SL_CELL object pointer head.

    // ************************************ //
    //      merge sort for CHAR_SLLIST      //
    // ************************************ //
void CHAR_SLLIST::mergesort()
{
   head = head->mergesort(head); 
}



Jim Peterson
1999-04-22