
138 • Java Programming
14. Write and test this method:
boolean isSorted(int[]a)
//returns true iff a[0]<=a[1]
<=a[2].....<=a[a.length-1]
15. Write an test this method:
int minimum(int[]a)
//returns the minimum element of
a[]
16. Write and test this method:
void shuffle(Object[]a)
//randomly permutes the elements
of a[]
17. Write and test this method:
double innerProduct(double[]x,
double[]y)
//returns the algebric inner prod-
uct (the sum of the component-
//wise product) of the two given
arrays as (algebraic) vectors
18. Write and test this method:
int[][]pascal(int size)
//returns ...