其实蛮容易实现的,关键是简洁与否,下面是我自己写的. function randomSort(a){ var arr = a, random = [], len = arr.length; for (var i = 0; i < len; i++) { var index = Math.floor(Math.random()*(len - i)); random.push(a[index]); arr.splice(index,1); } return random; } var a = [1,…
import java.util.Arrays; public class AddArray { public static void main(String[] args) { int[] arr = {1,4,2,4,11,33,22,67,43}; for (int i : sort(arr,23)) { System.out.print(i+"\t"); } System.out.println(); for (int i : sort1(arr,45)) { System.o…