Please explain briefly

I WANT to exactly what bool compare function return means if we want to soer to number then we make comparator function then bool compare(int a,int b)
{
return a>b;
}
then this function sort in increasing or decreasing ?? please explain… and what it return …

@AMIT_KUMAR
Comparator should return a boolean value in every case.
a<b is a boolean value since it returns true/false according to the values of a and b.

You can learn it as a fact, that in the comparator (T a, T b)
if you want to sort in increasing order you do a < b.
if you want to sort in decreasing order you do a > b.

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.