Thursday, October 11, 2012

Shuffle an arrary A[0... n-1]

1 comment:

  1. for(int i = 0; i < A.length - 1; i++) {
    int j = rand(i+1, A.length);
    swap(A, i, j);
    }

    ReplyDelete