diff --git a/Assignment10/bin/RecursiveExercise.class b/Assignment10/bin/RecursiveExercise.class index 054c6ce..f1c3ad2 100644 Binary files a/Assignment10/bin/RecursiveExercise.class and b/Assignment10/bin/RecursiveExercise.class differ diff --git a/Assignment10/src/RecursiveExercise.java b/Assignment10/src/RecursiveExercise.java index 3980031..af58b2c 100644 --- a/Assignment10/src/RecursiveExercise.java +++ b/Assignment10/src/RecursiveExercise.java @@ -20,12 +20,12 @@ public class RecursiveExercise { return null; if (ht.length == 1) return ht.clone(); - return append(new int[] { ht[ht.length - 1] }, - append(reverse(MyArrayUtil.tail(removeLast(ht.clone(), new int[ht.length - 1], 0))), new int[] { ht[0] })); + return append(new int[] { ht[ht.length - 1] }, append( + reverse(MyArrayUtil.tail(removeLast(ht.clone(), new int[ht.length - 1], 0))), new int[] { ht[0] })); } // Remove the last element - + public static int[] removeLast(int[] ia1, int[] ia2, int i) { ia2[i] = ia1[i]; if (i == ia2.length - 1)