for(i = 1; i < len; i++){
for(j = i - 1; j >= 0; --j){
if(data[j] > data[1 + j]){
swap(j, j + 1);
} else {
break;
}
}
}
swap method does swapping elements. Why it should be --j instead of j-- ? what is the difference ? what is the advantage of putting j-- ?