A set of sequential utilities.
More...
#include <vector>#include "seqUtils.tcc"
Go to the source code of this file.
Namespaces | |
| namespace | seq |
| Collection of Generic Sequential Functions. | |
Functions | |
| template<typename T > | |
| void | seq::flashsort (T *a, int n, int m, int *ctr) |
| Flash sort algo to sort an array in O(n). | |
| template<typename T > | |
| void | seq::makeVectorUnique (std::vector< T > &vec, bool isSorted) |
| Removes duplicates from the vector. | |
| template<typename T > | |
| bool | seq::BinarySearch (const T *arr, unsigned int nelem, const T &key, unsigned int *idx) |
| A binary search implementation. | |
| template<typename T > | |
| int | seq::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. | |
| template<typename T > | |
| bool | seq::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. | |
A set of sequential utilities.
Definition in file seqUtils.h.