seal::MergeSort< T > Class Template Reference

#include <sort.h>

Inheritance diagram for seal::MergeSort< T >:

seal::SortingAlgorithm< T >

List of all members.

Public Member Functions

 MergeSort (void)
virtual ~MergeSort ()
virtual void operator() (RandomAccess< T > &array, int from, int to, SortOrder order=ASCENDING)
virtual void sort (RandomAccess< T > &array, int from, int to, SortOrder order=ASCENDING)


Detailed Description

template<typename T>
class seal::MergeSort< T >

This class encapsulates the merge sort algorithm. Elements of any data structure which implements the RandomAccess interface (that is, elements of any data structure which is derived from the abstract base class RandomAccess) can be sorted using this algorithm class.

Constructor & Destructor Documentation

template<typename T>
seal::MergeSort< T >::MergeSort ( void   )  [inline]

Default constructor.

template<typename T>
virtual seal::MergeSort< T >::~MergeSort (  )  [inline, virtual]

Virtual destructor.


Member Function Documentation

template<typename T>
void seal::MergeSort< T >::operator() ( RandomAccess< T > &  array,
int  from,
int  to,
SortOrder  order = ASCENDING 
) [inline, virtual]

The operator which performs the actual sorting of the elements using the merge sort algorithm.

Parameters:
array The data structure whose elements will be sorted.
from The elements starting from this index in the data structure will be sorted in the order requested.
to The elements upto this index in the data structure will be sorted in the order requested.
order The order in which the elements will be sorted.

Reimplemented from seal::SortingAlgorithm< T >.

template<typename T>
virtual void seal::MergeSort< T >::sort ( RandomAccess< T > &  array,
int  from,
int  to,
SortOrder  order = ASCENDING 
) [inline, virtual]

The function which performs the actual sorting of the elements using the merge sort algorithm.

Parameters:
array The data structure whose elements will be sorted.
from The elements starting from this index in the data structure will be sorted in the order requested.
to The elements upto this index in the data structure will be sorted in the order requested.
order The order in which the elements will be sorted.

Implements seal::SortingAlgorithm< T >.


The documentation for this class was generated from the following file:

Generated on Sat May 16 21:35:21 2009 for SEAL by  doxygen 1.5.5