t
.
*
* @pre t.size() is greater than 0
*
* @param t
* a non-empty list
* @return the minimum element in t
*/
public static int min(Listn
times by a factor of 2 using
* recursion. See the lab problem for a description of downsampling.
*
* @pre the width and height of the picture are both multiples of 2 to the
* power n
*
* @pre1 n is greater than or equal to zero
*
* @param p
* the picture to downsample
* @param n
* the number of times to downsample the picture by a factor of 2
* @return the downsampled picture
*/
public static Picture downsample(Picture p, int n) {
}
/**
* Binary search for the string s
in a list t
. If
* s
is in the list, then this method returns the index of the
* location of s
in t
; otherwise, this method
* returns the index where s
would be located if it were to be
* inserted into the list t
.
*
*
* This method does not modify the list t
.
*
* @pre t.size() is zero or more
* @pre1 t is in sorted order
* @pre2 t has no duplicate elements
*
* @param s
* a string
* @param t
* a list
* @return the index of s if s is in the list; otherwise, returns the index
* where s would be located if it were to be inserted into the list
*/
public static int bsearch(String s, List