|
From: Brendan M. <mc...@us...> - 2006-08-06 01:27:22
|
Update of /cvsroot/jigs/jigs/src/edu/whitman/halfway/util In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12721/src/edu/whitman/halfway/util Modified Files: MiscUtil.java Log Message: Index: MiscUtil.java =================================================================== RCS file: /cvsroot/jigs/jigs/src/edu/whitman/halfway/util/MiscUtil.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** MiscUtil.java 29 Mar 2005 16:06:14 -0000 1.20 --- MiscUtil.java 6 Aug 2006 01:27:18 -0000 1.21 *************** *** 22,25 **** --- 22,33 ---- + public static final void reverse(int[] a){ + for(int i=0, j=a.length-1; i<a.length; i++, j--){ + int temp = a[i]; + a[i] = a[j]; + a[j] = temp; + } + } + /* Returns true if a contains any element appearing in b */ public static final boolean containsAny(Collection a, Collection b){ |