Site Search:

squares2

0
1
2
3
4
5
6
7
8
9
function bubbleSort(a) {
  var N = a.length;
  for (var i = 0; i < N; i++) {
     var min = i;
     for (j = i+1; j < N; j++) {
       if (a[j] < a[min]) min = j;
     }
     exch(a, i, min);
  } 
}