39 template <
typename T>
void flashsort(T* a,
int n,
int m,
int *ctr);
63 bool BinarySearch(
const T* arr,
unsigned int nelem,
const T & key,
unsigned int *idx) ;
75 int UpperBound (
unsigned int nelem,
const T * arr,
unsigned int startIdx,
const T & key);
89 bool maxLowerBound(
const std::vector<T> & arr,
const T & key,
unsigned int & retIdx,
90 unsigned int* leftIdx,
unsigned int* rightIdx);
103 #include "seqUtils.tcc" bool BinarySearch(const T *arr, unsigned int nelem, const T &key, unsigned int *idx)
A binary search implementation.
void flashsort(T *a, int n, int m, int *ctr)
Flash sort algo to sort an array in O(n).
void makeVectorUnique(std::vector< T > &vec, bool isSorted)
Removes duplicates from the vector.
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.
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...
Collection of Generic Sequential Functions.