UNIVERS
15.3
UNIVERS base processing software API
|
#include <sorter.hpp>
Public Member Functions | |
void | qsort (bool bAscent=true) |
virtual int | countItems ()=0 |
virtual int | compareItems (int i1, int i2)=0 |
virtual void | exchangeItems (int i1, int i2)=0 |
Class provides sorting and binary search functionality for custom objects with arbitrary storage nature.
Class should be specialized to exact object specifics by implementing several abstract methods.
|
pure virtual |
Compare two items with mentioned indeces and return -1 if the first item is less than the second, 0 if two items are equal and 1 if the first one is greater than the second.
|
pure virtual |
Return number of items in data container.
|
pure virtual |
Exchange two items with mentioned indeces.
void Sorter::qsort | ( | bool | bAscent = true | ) |
QuickSort algorithm implementation for ascent or descent order.