The_Most_Chalishkanchik's blog

By The_Most_Chalishkanchik, history, 12 months ago, In English

I often have problems when I need to find a certain 'x' in the position of the first elements in the pair vector. Of course, it's better to write your own binary search. But can someone explain how it works anyway?

| Write comment?
»
12 months ago, # |
Rev. 2   Vote: I like it +10 Vote: I do not like it

They work in the same way as integers. Pairs by default are compared by the first elements, if the first elements are equal then compare by second elements.