How compare function is working

at time stamp 8:17
according to me i is starting from 1 and j is 0 and now we checking a[i] with a[j] and inc j by 1.
we start from 2 a[1] and 1 as a[0] as 2 is greater than 2 nothing happens.
now 5 must be checked for 5 and 1 but that doesnt happens we check it for 2 only, why?
in 4 we 1st check with 1 then for 2 then for 5

completely struct with the explanantion of this compare function working.

basically i want to know how this sort funtion works which sorting is it using.

You don’t have to worry about the inner functionality which is carried out. Just remember that the following comparator function sorts in descending order.
bool comp(int a, int b)
{
if(a>b)
return true;
else
return false;
}

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.