The first instance of definition of comparator function has random zeroes at some indexes in the array.
The second instance of definition of comparator function works fine. Could anyone explain why this is happening
bool func(long long a, long long b){
return (a >= b);
}
sort (A+1, A + 1000 + 1, func);
bool func(long long a, long long b){
return (a > b);
}
sort (A+1, A + 1000 + 1, func);
Output 1:
1000000 1000000 1000000 0 0 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000
Output 2:
1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000