标签:
public ArrayList<Integer> reverse(ArrayList<Integer> list) { for(int i = 0, j = list.size() - 1; i < j; i++) { list.add(i, list.remove(j)); } return list; }
remove(int index)
add(E e)
add(int index, E element)
Reverse an ArrayList
原文地址:http://www.cnblogs.com/hygeia/p/5090548.html