snippets 0.1.0
Loading...
Searching...
No Matches
sorted_utils.hpp File Reference
#include <vector>
#include <concepts>
#include <optional>
#include <functional>
#include <tuple>
Include dependency graph for sorted_utils.hpp:

Go to the source code of this file.

Namespaces

namespace  hsc_snippets
 

Functions

template<std::totally_ordered T>
int hsc_snippets::numOfGreaterElements (const std::vector< T > &v, T value)
 
template<std::integral T>
bool hsc_snippets::containsInRange (const std::vector< T > &vec, T start, T end)
 
template<typename T , std::integral I = int>
std::optional< I > hsc_snippets::deferred_binary_search (I low, I high, const T &value, auto &&func)
 
template<typename T , std::integral I = int>
hsc_snippets::deferred_upper_bound (I low, I high, const T &value, auto &&func, auto &&comp)
 
template<typename T , std::integral I = int>
hsc_snippets::deferred_upper_bound (I low, I high, const T &value, auto &&func)
 
template<typename T , std::integral I = int>
hsc_snippets::deferred_lower_bound (I low, I high, const T &value, auto &&func, auto &&comp)
 
template<typename T , std::integral I = int>
hsc_snippets::deferred_lower_bound (I low, I high, const T &value, auto &&func)
 
template<std::integral T>
void hsc_snippets::sortThree (T &a, T &b, T &c)
 
static std::tuple< std::function< int(int)>, int > hsc_snippets::create_compression_mapper (const std::vector< int > &nums)