3 ms·
You could perhaps implement std::equal_range() [0] that way. It behaves somewhat similarly to doing two slightly different binary searches (to find both the lo
by a_e_k 12y ago
You could perhaps implement std::equal_range() [0] that way. It behaves somewhat similarly to doing two slightly different binary searches (to find both the lower and upper bounds on where a key could be legally inserted into a sorted range).
[0] http://en.cppreference.com/w/cpp/algorithm/equal_range http://en.cppreference.com/w/cpp/algorithm/equal_range