On 07/11/2012 09:20 AM, Noel Grandin wrote:

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/
Excellent! :-)

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php



_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to