CombSort< T > Class Template Reference

A CombSort implementation for sorting arrays. More...

#include <combsort.h>

Inheritance diagram for CombSort< T >:

Sorter< T >

List of all members.

Public Member Functions

int Sort (T *_array, size_t _size)
 Sorts an array using the CombSort method.


Detailed Description

template<class T>
class CrissCross::Data::CombSort< T >

A CombSort implementation for sorting arrays.

CombSort isn't intended for mainstream use, but it's technically very interesting. The main reason it's interesting is that it was created by making some relatively small changes to BubbleSort. These tiny changes made a new algorithm that still rivals more mainstream algorithms like HeapSort, ShellSort, and others.


Member Function Documentation

int Sort ( T *  _array,
size_t  _size 
) [inline, virtual]

Sorts an array using the CombSort method.

Parameters:
_array The array to sort.
_size The size of the array to sort.
Returns:
0 on success.

Implements Sorter< T >.

References CrissCross::Data::Compare(), and Sorter< T >::Swap().


Generated on Sun Feb 8 11:10:00 2009 for CrissCross by  doxygen 1.5.8