

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object CodeCamp
public class CodeCamp
Constructor Summary  

CodeCamp()

Method Summary  

static int 
getValueOfMostValuablePlot(int[][] city)
Given a 2D array of ints return the value of the most valuable contigous sub rectangle in the 2D array. 
static int 
hammingDistance(int[] aList,
int[] bList)
Determine the Hamming distance between two arrays of ints. 
static boolean 
isPermutation(int[] listA,
int[] listB)
Determine if one array of ints is a permutation of another. 
static int 
mostVowels(String[] list)
Determine the index of the String that has the largest number of vowels. 
static boolean 
queensAreSafe(char[][] board)
Determine if the chess board represented by board is a safe set up. 
static int 
sharedBirthdays(int numPeople,
int numDaysInYear)
Perform an experiment simulating the birthday problem. 
Methods inherited from class java.lang.Object 

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 

public CodeCamp()
Method Detail 

public static int hammingDistance(int[] aList, int[] bList)
aList
 != null, aList.length == bList.lengthbList
 != null, bList.length == aList.length
public static boolean isPermutation(int[] listA, int[] listB)
listA
 != nulllistB
 != null
public static int mostVowels(String[] list)
pre: list != null, list.length > 0, there is an least 1 non null element in list
post: return the index of the nonnull element in list that has the largest number of characters that are vowels. If there is a tie return the index closest to zero. The empty String, "", has zero vowels. It is possible for the maximum number of vowels to be 0.
list
 the array to check
public static int sharedBirthdays(int numPeople, int numDaysInYear)
numPeople
 The number of people in the experiment.
This value must be > 0numDaysInYear
 The number of days in the year for this experiement.
This value must be > 0
public static boolean queensAreSafe(char[][] board)
pre: board != null, board.length > 0, board is a square matrix.
(In other words all rows in board have board.length columns.),
all elements of board == 'q' or '.'. 'q's represent queens, '.'s
represent open spaces.
post: return true if the configuration of board is safe, that is no queen can attack any other queen on the board. false otherwise. the parameter board is not altered as a result of this method.
board
 the chessboard
public static int getValueOfMostValuablePlot(int[][] city)
pre: mat != null, mat.length > 0, mat[0].length > 0, mat is a rectangular matrix.
post: return the value of the most valuable contigous sub rectangle in city.
city
 The 2D array of ints representing the value of
each block in a portion of a city.


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 