Compare Function?

How does this Compare function work in general ? please provide the detail explanation of numeric and lexicographic
comparison

@StreamerX

  1. numeric comparison : in the compare function(int a,int b) return a<b; this will sort the array in increasing order. here the value of a and b is considered.
  2. String comparison : in the compare function(string a,string b) return a<b; this will sort the array in lexicographical order. lexicographical order is similar to what you find in the english dictionary.

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.