MCPcopy Create free account
hub / github.com/KaisenAmin/c_std / algorithm_equal_range

Function algorithm_equal_range

algorithm/algorithm.c:1383–1393  ·  view source on GitHub ↗

* @brief Finds the range of elements that are equal to a specified value in a sorted range. * * This function returns a `Pair` representing the range of elements in the sorted array `base` * that are equal to the value `val`, as determined by the comparison function `comp`. The * `first` element in the `Pair` is the first element in the range, and the `second` element * is one past the last e

Source from the content-addressed store, hash-verified

1381 * `first` points to the first element in the range, and `second` points to one past the last element.
1382 */
1383Pair algorithm_equal_range(const void *base, size_t num, size_t size, const void *val, CompareFunc comp) {
1384 ALGORITHM_LOG("[algorithm_equal_range] Info: Finding equal range for value in array with %zu elements.", num);
1385
1386
1387 Pair range;
1388 range.first = algorithm_lower_bound(base, num, size, val, comp);
1389 range.second = algorithm_upper_bound(base, num, size, val, comp);
1390
1391 ALGORITHM_LOG("[algorithm_equal_range] Success: Equal range found.");
1392 return range;
1393}
1394
1395
1396/**

Callers

nothing calls this directly

Calls 2

algorithm_lower_boundFunction · 0.85
algorithm_upper_boundFunction · 0.85

Tested by

no test coverage detected