Skip to content

Latest commit

 

History

History
16 lines (14 loc) · 291 Bytes

File metadata and controls

16 lines (14 loc) · 291 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]);
        }
    }
}