During defining of function
void bubble_sort(int a[ ],int n,bool(&cmp)(int a, int b)
why we are giving & symbol
Problem related to & symbol
hello @vikash3303
we are passing cmp function as reference thats why we are using & symbol before function name.

here it should be j<n-1
why we have used j<n-1;why can’t we use j<n;
for this case j+1 will be invalid when j=n-1 thats why