Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

mergesort.h File Reference


Detailed Description

Mergesort implementation.

This provides an in-place iterative implementation of MergeSort that works on the linked lists defined in list.h.

#include "list.h"

Go to the source code of this file.

Functions

void mergesort_list (struct list *lst, cmp_op_t cmp)
 Sort linked list using MergeSort.


Function Documentation

void mergesort_list struct list *  lst,
cmp_op_t  cmp
 

Sort linked list using MergeSort.

This allows for a custom comparator that takes two data pointers and returns a number less than 0 if the first object is less than the second, 0 if the the objects are equal, and a number greater than 0 if the first object is greater than the second. An example of this is strcmp.

Parameters:
lst Linked list.
cmp Comparator function.


Generated on Thu Jul 2 15:49:25 2009 for cctools by  doxygen 1.3.9.1