Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


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




Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.