if we write return a<b orb<a in sort function comparator of string what happens when true or false is returned and when is true or false returned i am always getting confused in return statment how to form it?
How does the return statement in comaparator function used
@be10046.19 best way to understand to use the comparator is like this-
lets take example of an array first say you want to sort it in decreasing order. (remember you always passes two arguments in comparator and consider them adjacent) so if we want to sort dec you pass a and b and return a>b (means desc)
now lets say you are sorting a array of strings in descending order so you simply pass two strings s1 and s2 as parameter and return s1>s2(desc)
now if there is a condition that you want to sort in decreasing order of length and if length = sort ascending so here is comparator for that
if(s1.length()==s2.length()) return s1<s2;
else return s1.length()>s2.length()
i hope after these examples you got the idea.
if its cleared hit like and dont forget to mark the doubt as resolved 
in descending order (generally means a>b) so doing s1>s2 means we are sorting in desc order.
comparator is also type of stl built by the developers so there are lot of things in it but we cant remember it all so remembering is easy when its little related to what we want to do like for descending a>b and asc a<b