You are viewing a single comment's thread. Return to all comments →
int count = 0,n=arr.size(); for (int i = 0; i < n - 1; i++) for (int j = i + 1; j < n; j++) if (arr[i] > arr[j]) count++; return count;
Running Time of Algorithms
You are viewing a single comment's thread. Return to all comments →