Search Results

Searching for: for each loop

Individual Exercises

0 / 10

This method simulates flipping a fair coin. It takes an integer parameter, which specifies the number of times that the coin is to be...

0 / 20

This method simulates flipping a fair coin. The coin is flipped repeatedly until three heads are seen. The method takes an integer...

0 / 10

this method accepts a String object as a parameter. It returns true if the String has all unique characters, false otherwise. For...

0 / 10

This method takes an ArrayList of integers as a parameter and does not return anything. The method will expand the list with a mirrored...

0 / 20

This method takes an ArrayList of integers as a parameter and does not return anything. The method will remove all of the odd elements in...

0 / 20

This method takes an ArrayList of integers as a parameter and does not return anything. The method will repeat each odd element in the...

0 / 10

The code below finds the largest number in an int array. What is the growth rate, Big O(), of this method?

// Return the position of...
0 / 10

The code below finds a specific number in an int array. What is the growth rate, Big O(), of this method, on average?

static int...
0 / 10

The code below finds a specific number in an int array. What is the best case estimation for performance, Big O(), for this method?

...
0 / 10

The code below finds a specific number in an int array. What is the worst case estimation for performance, Big O(), for this method?

...
0 / 10

The code below counts the number of elements that appear in duplicate in an array. Which of the folowing statements are true?

static int...