As it is seen the compare function is called multiple times by sort function internally, how to know which two numbers will be passed to compare function by sort function in particular pass?
Compare function calling using sort function
bool comp(int a, int b)
{
if(a>b)
return true;
}
This comparator function sorts the array in descending order. Just remember this information. That’s it.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.