for i from 0 to n-1 do j <- random integer such that i <= j < n exchange a[i] and a[j]