// purpose: perform simple list processing activities import java.util.*; public class Array { // print(): display a public static void print( int[] a ) { // if ( a == null ) { System.out.println( "null" ); return; } for (int i = 0; i < a.length; ++i ) { System.out.print( a[ i ] + " " ); } } // println(): display a and a newline public static void println( int[] a ) { } // randomize(): set elements of a to random values between 0 and n-1 public static void randomize( int[] a, int n ) { } // sum(): produce the sum of the elements in a public static int sum( int[] a ) { int sum = 0; for (int i = 0; i < a.length; ++i ) { sum = sum + a[ i ]; } return sum; } // copy(): produce a new array that is identical to a public static int[] copy( int[] a ) { int n = a.length; int[] b = new int[ n ]; for ( int i = 0; i < n; ++i ) { b[ i ] = a[ i ]; } return b; } // max(): produces a new array whose elements are the max of the // corresponding elements of a and b public static int[] max( int[] a, int[] b ) { if ( a.length != b.length ) { return null; } else { int n = a.length; int[] c = new int[ n ]; return c; } } }