Consider the following code segment:
int j, k,n;
for(j=1;j<=n-1;j++){
for(k=j+1;k<n;k++){
if(A[j]> A[k]){
A[j]=A[j+2];
}
}
}
(Where n is the size of array A[ ] and starting index is 1)
Number of comparison made by the above code when n = 84 ________.
given answer is 84*83/2 =3486
shouldn’t it be 83*82/2 = 3403