|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectCodeCampSummer
public class CodeCampSummer
| Constructor Summary | |
|---|---|
CodeCampSummer()
|
|
| Method Summary | |
|---|---|
static int |
findMajority(int[] list)
Determine if there is a majority element in an array of ints. |
static void |
main(String[] args)
|
static ArrayList<Integer> |
matches(String source,
String target)
Find all indices in source that are the start of a complete match of target. |
static int |
mostVowels(String[] list)
Determine the index of the String that has the largest number of vowels. |
static int |
sharedBirthdays(int numPeople,
int numDays)
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 CodeCampSummer()
| Method Detail |
|---|
public static void main(String[] args)
public static ArrayList<Integer> matches(String source,
String target)
source - != null, source.length() > 0target - != null, target.length() > 0
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 non-null 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 findMajority(int[] list)
list - != null
public static int sharedBirthdays(int numPeople,
int numDays)
numPeople - The number of people in the experiment.
This value must be > 0numDays - The number of days in the year for this experiement.
This value must be > 0
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||