原理:每次从已知数组随机一个数,然后将数组的最后一个值 赋值给前面随机到的数的位置上,然后remove数组最后一个
code:private List<TreeObject> shuffle(List<TreeObject> list){
int count = 0;
int size = list.size();
int random = new Random().nextInt(size);
while(count <= size){
TreeObject last = list.get(size-1);
list.add(random, last);
list.remove(size);
count++;
}
return list;
}