RFC: where to put sorted vector template/class?

Noel Grandin noel at peralex.com
Wed Jul 11 06:20:22 PDT 2012


On 2012-07-11 15:16, Andrew Douglas Pitonyak wrote:
> How large do you expect the sorted vector to be? I ask because a 
> linear search is used, which on average will take time n/2 to find the 
> item and n to not find the item (assuming vector of size n).

No, std::lower_bound performs a binary search.
http://www.cplusplus.com/reference/algorithm/lower_bound/

Disclaimer: http://www.peralex.com/disclaimer.html




More information about the LibreOffice mailing list