Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 292 Bytes

shuffle-sort.md

File metadata and controls

17 lines (14 loc) · 292 Bytes

Shuffle sort

Java Implementation

public class dummy{
    public void shuffle(Object[] a){
        int N = a.length;
        Random rand;
        for(int i=0;i<N;i++){
            int randomNum = rand.nextInt(i + 1);
            swap(a[i], a[randomNum]);
        }
    }
}