On Feb 20, 8:50 pm, "ken" <ken.carl...@gmail.comwrote:

Hi,

Is there a std algorithm which find the smallest item in a vector?

One way to do it is to use the sort algorithm and then get the first

element.

But what if I just care about the smallest, so I don't care if the

rest of the vector is sorted according.

Is there a more efficient solution to my problem?

Thank you.

Okay I find a solution:

std::min_element