you are here->home->Class 12->Selection Sort
Selection Sort
1)The best-case swaps required in the selection sort for n elements is _______.?

2)The worst-case swaps required in in the selection sort for n elements is ______.?

3)Consider the following list of numbers and what is the status of the list after the fifth pass when we use the selection sort?
Input: 4, 3, 2, 10, 12, 1, 5, 6

4)Which of the following best describes the key characteristic of the Selection Sort algorithm?

5)Identify the correct statement from below, S1: append () adds only a single item or object at a time. S2: append () cannot use with list data structure.

6)The len() function return _____. S1: returns the number of characters in the string. S2: returns the number of items in an object.

7)What is the use of the statement “arr=[ ]“

8)Selection sort is not a very efficient algorithm when data list is large.

9)What is the output generated by the following code
def selectionSort(array, size):
for ind in range(size):
min_index = ind
for j in range(ind + 1, size):
if array[j] > array[min_index]:
min_index = j
(array[ind], array[min_index]) =
(array[min_index], array[ind])
arr = [-2, 45, 0, 11, -9, 88, -97, -202, 747]
size = len(arr)
selectionSort(arr, size)

10)What is the advantage of selection sorting over other sorting techniques?