Selection Sort

Help Questions

AP Computer Science A › Selection Sort

Questions 1 - 10
1

True or False.

Selection sort is quicker than MergeSort.

False

True

Explanation

MergeSort is has a running time of O(N). Selection sort has a running time of O(N2). Selection sort has O(N2) comparisons due to the swap in the algorithm.

2

True or False.

Selection sort is quicker than MergeSort.

False

True

Explanation

MergeSort is has a running time of O(N). Selection sort has a running time of O(N2). Selection sort has O(N2) comparisons due to the swap in the algorithm.

3

True or False.

Selection sort is quicker than MergeSort.

False

True

Explanation

MergeSort is has a running time of O(N). Selection sort has a running time of O(N2). Selection sort has O(N2) comparisons due to the swap in the algorithm.

4

True or False.

Selection sort is quicker than MergeSort.

False

True

Explanation

MergeSort is has a running time of O(N). Selection sort has a running time of O(N2). Selection sort has O(N2) comparisons due to the swap in the algorithm.

5

What is the worst-case run-time of selection sort (in Big-O notation?)

Explanation

Selection sort is comprised of outer and inner for loops that swap elements of the unsorted array into a sorted array. The largest possible number of times each loop can run is the number of elements in the array. Thus, the worst possible run time is .

6

What is the worst-case run-time of selection sort (in Big-O notation?)

Explanation

Selection sort is comprised of outer and inner for loops that swap elements of the unsorted array into a sorted array. The largest possible number of times each loop can run is the number of elements in the array. Thus, the worst possible run time is .

7

What is the worst-case run-time of selection sort (in Big-O notation?)

Explanation

Selection sort is comprised of outer and inner for loops that swap elements of the unsorted array into a sorted array. The largest possible number of times each loop can run is the number of elements in the array. Thus, the worst possible run time is .

8

What is the worst-case run-time of selection sort (in Big-O notation?)

Explanation

Selection sort is comprised of outer and inner for loops that swap elements of the unsorted array into a sorted array. The largest possible number of times each loop can run is the number of elements in the array. Thus, the worst possible run time is .

9

What is the worst-case run-time of selection sort (in Big-O notation?)

Explanation

Selection sort is comprised of outer and inner for loops that swap elements of the unsorted array into a sorted array. The largest possible number of times each loop can run is the number of elements in the array. Thus, the worst possible run time is .

10

True or False.

Selection sort is quicker than MergeSort.

False

False

True

True

Explanation

MergeSort is has a running time of O(N). Selection sort has a running time of O(N2). Selection sort has O(N2) comparisons due to the swap in the algorithm.

Return to subject