mergesort.h File Reference

Mergesort implementation. More...

#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.

Detailed Description

Mergesort implementation.

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


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 Sun Aug 14 23:01:35 2011 for cctools by  doxygen 1.6.1