Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Random;

public class Main {
    public static int[] randomSort(int[] seed) {
        int len = seed.length;
        int[] result = new int[len];
        Random random = new Random();
        for (int i = 0; i < len; i++) {
            int r = random.nextInt(len - i);
            result[i] = seed[r];
            seed[r] = seed[len - 1 - i];
        }
        return result;
    }
}