Use of comare function in sort function

im not able to understand how compare function will work in side the sort function
a>b and b>a from this how can we decide wether it will get sorted in increasing or decreasing order.
plzz clear my doubt

hi @vivekthakur8102000
In the compare function,
a < b implies sorting in increasing order
and a > b implies sorting in decreasing order

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.