Classes | |
class | seq::IndexHolder< T > |
A small helper class used while sorting a pair of value and its index in an array/vector. More... | |
Functions | |
template<typename T> | |
bool | BinarySearch (const T *arr, unsigned int nelem, const T &key, unsigned int *idx) |
A binary search implementation. | |
template<typename T> | |
void | flashsort (T *a, int n, int m, int *ctr) |
Flash sort algo to sort an array in O(n). | |
template<typename T> | |
void | makeVectorUnique (std::vector< T > &vec, bool isSorted) |
Removes duplicates from the vector. | |
template<typename T> | |
bool | maxLowerBound (const std::vector< T > &arr, const T &key, unsigned int &retIdx, unsigned int *leftIdx, unsigned int *rightIdx) |
Finds the index of the greatest lower bound of the search key in the array. The implementation uses a simple modification of the binary search algorithm. | |
template<typename T> | |
int | UpperBound (unsigned int nelem, const T *arr, unsigned int startIdx, const T &key) |
Finds the index of the smallest upper bound of the search key in the array. |
|
A binary search implementation.
Definition at line 13 of file seqUtils.txx. Referenced by ot::flagNodesType2(). |
|
Flash sort algo to sort an array in O(n).
Templated version of flashsort based on original C code by Karl-Dietrich Neubert. Definition at line 119 of file seqUtils.txx. |
|
Removes duplicates from the vector.
Definition at line 97 of file seqUtils.txx. References sort(). Referenced by ot::TreeNode::balanceSubtree(), ot::TreeNode::completeSubtree(), and ot::test::isBalancedInternal(). |
|
Finds the index of the greatest lower bound of the search key in the array. The implementation uses a simple modification of the binary search algorithm.
Definition at line 52 of file seqUtils.txx. Referenced by ot::test::isBalancedInternal(). |
|
Finds the index of the smallest upper bound of the search key in the array.
Definition at line 36 of file seqUtils.txx. |