






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







The static method reverse has the following prototype: public static String reverse(int[] a) The method returns a string with the elements of the integer array in reverse order. For example, the method call reverse(new int[]{10, 20, 30}) will generate the string 30 20 10. An empty space should appear between elements. The method should return the empty string (“”) if an array of size zero is provided. Feel free to add an auxiliary method. Non-recursive solutions will receive no credit. One possible solution: public static String reverse(int[] a) { if (a == null || a.length == 0) return ""; return reverseAux(a, 0); } private static String reverseAux(int[] b, int index) { if (index == b.length-1) return String.valueOf(b[index]); else return reverseAux(b, index+1) + " " + b[index]; }
about roads between cities. For example, to represent that a road named “I-98” exists between city “A” and “B” we create a list with elements “A” and “B”, and then map that list to the string “I-98”. An incomplete MapquestJr class is presented below. public class MapquestJr { Map<List
return route;
What you must implement