Which of the following sorting algorithms is described by this text? "Find the smallest item in the array or ArrayList, and store it at index 0. Then, find the smallest remaining item, and store it at index 1. Continue this process until all items are placed into the array or ArrayList." (3 points)
Question 8 options:
What is required to implement a binary search? (2 points)
Question 9 options:
| |
| |
| |
| |
| 5) | None of the above is required | |
An array of integers is to be sorted from smallest to biggest using an insertion sort. Assume the array originally contains the following elements:
9 13 24 3 17 20
What will it look like after the third pass through the for loop? (3 points)
Question 10 options:
An array of integers is to be sorted from smallest to biggest using a selection sort. Assume the array originally contains the following elements:
10 12 23 4 16 21
What will it look like after the third pass through the for loop? (3 points)
Question 11 options:
What is the minimum number of locations that a sequential search algorithm will have to examine when looking for a particular value in an array of 300 elements? (2 points)
Question 4 options:
Which of the following sorting algorithms is the fastest? (2 points)
Question 1 options:
Which sorting algorithm will be fastest when run on an array that happens to already be in order? (2 points)
Question 2 options:
| |
| |
| |
| 4) | All of these algorithms will run at the same speed. | |
| 5) | It is not possible to know which will be fastest. | |
What is the maximum number of locations that a sequential search algorithm will have to examine when looking for a particular value in an array of 200 elements? (2 points)
Question 3 options:
What is the minimum number of locations that a binary search algorithm will have to examine when looking for a particular value in a sorted array of 200 elements? (2 points)
Question 5 options:
What is the maximum number of locations that a binary search algorithm will have to examine when looking for a particular value in a sorted array of 300 elements? (2 points)
Question 6 options:
Which of the following is not a quadratic sorting algorithm??(2 points)
I. insertion sort II. selection sort III. mergesort
Question 7 options: