#include <sort.h>
Public Member Functions | |
BubbleSort (void) | |
virtual | ~BubbleSort () |
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) |
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. seal::BubbleSort< T >::BubbleSort | ( | void | ) | [inline] |
Default constructor.
virtual seal::BubbleSort< T >::~BubbleSort | ( | ) | [inline, virtual] |
Virtual destructor.
void seal::BubbleSort< 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 bubble sort algorithm.
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 >.
virtual void seal::BubbleSort< 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 bubble sort algorithm.
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 >.