Class BinnedStringSearch

Class Documentation

class BinnedStringSearch

the search by interpolation of a sorted array of strings by bins

Public Functions

explicit BinnedStringSearch(std::vector<std::string> A)

the bins of the integers of the first 8 characters of A

Pre:

A is sorted (an audit)

std::size_t lexicographicPosition(std::string_view Q) const

the number of strings smaller than Q

Post:

A[ r - 1 ] < Q <= A[ r ]

std::size_t prefixEnd(std::string_view P) const

the number of strings smaller than P#

std::pair<std::size_t, std::size_t> prefixRange(std::string_view P) const

the range [ l , r ) of the strings prefixed by P

const BinnedSearch &keys(void) const