Explain compare function

Please explain compare function in sorting as well as sets

Hey @Prateek-Agrawal-2382104072081451 ,
compare function dictates how the sorting is to be done in c++ the default sorting is in increasing order of the values and the compare function basically dictates the order in which elements will be sorted .
We can make many kinds of compar function which will sort element in increasing order of value , decreasing order of value , increasing order of freq and a lot more