One Dimensional Arrays and Sorting Quiz

Answer the following questions to test your reading of the notes. It is permissible to switch back to the notes to find the correct answers. You may also retake the quiz as may times as needed to get a perfect score.

Question 1 True or False

True False
Arrays should always be used when there is a list of values to work with.
An array can be created with any type of variable, such as int or string.
An array can be a mixture of some int variables and some string variables.
The selection sort is the most efficient sort taught in this section.

Question 2 Multiple Choice - select the best answer

The number of passes through an array of 20 elements using a selection sort is:

  1. 0
  2. 19
  3. 20
  4. 21
  5. depends on the order of the items in the array

Question 3

The number of passes through an array of 20 elements using a bubble sort is:

  1. 0
  2. 19
  3. 20
  4. 21
  5. depends on the order of the items in the array

Question 4

The number of passes through an array of 20 elements using a modified bubble sort is:

  1. 0
  2. 19
  3. 20
  4. 21
  5. depends on the order of the items in the array

Question 5

The number of comparisons used with an array of 7 elements using a selection sort is:

  1. 6
  2. 7
  3. 8
  4. 21
  5. depends on the order of the items in the array

Question 6

The number of comparisons used with an array of 7 elements using a bubble sort is:

  1. 6
  2. 7
  3. 8
  4. 21
  5. depends on the order of the items in the array

Question 7

The number of comparisons used with an array of 7 elements using a modified bubble sort is:

  1. 6
  2. 7
  3. 8
  4. 21
  5. depends on the order of the items in the array