K
ken
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.
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.