3 ms·
I'm not sure why std::sort should require two comparisons. It's not required to be stable (neither is qsort), so when comparing a and b gives (a >= b), std::so
by yongjik 12y ago
I'm not sure why std::sort should require two comparisons. It's not required to be stable (neither is qsort), so when comparing a and b gives (a >= b), std::sort can just assume (a > b) and the array will be sorted just fine.
- ridiculous_fish 12y agoOops, you are correct and I was mistaken. std::sort does not need to determine the total order in order to sort. I would amend my top-level comment but I don't seem able to.