Is there a function like std::sort that instead of sorting in increasing order, sorts in decreasing order?
Yes. It's called std::sort.
sort has an overload that takes a functor that defines the sort order as a third parameter. If you want decreasing order, then pass it std::greater<T>(), where T is your type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With