Closed GoogleCodeExporter closed 9 years ago
Note that we have methods that could be turned into what you want by adding
javadoc, precondition checks, unit tests, etc.
136: public static int indexOf(int[] array, int target) {
137: return indexOf(array, target, 0, array.length);
138: }
139:
140: // TODO: consider making this public
141: private static int indexOf(
142: int[] array, int target, int start, int end) {
143: for (int i = start; i < end; i++) {
144: if (array[i] == target) {
145: return i;
146: }
147: }
148: return -1;
149: }
Original comment by kevinb@google.com
on 12 Jan 2011 at 10:55
Original comment by kevinb@google.com
on 13 Jul 2011 at 6:18
Original issue reported on code.google.com by
stevenro...@gmail.com
on 18 Nov 2010 at 6:06