# 02 - Sorting Algorithms

1. a sorting algorithm is an algorithm that …
` The most frequently used orders are numerical order and lexicographical order`

sorts an item that has been searched for and puts it first

searches for lists and sorts the answers

puts elements of a list in a certain order.

2. Among the authors of early sorting algorithms around 1951 was Betty Holberton,who worked on ENIAC and UNIVAC
`From the beginning of computing, the sorting problem has attracted a great deal of research, perhaps due to the complexity of solving it efficiently despite its simple, familiar statement.` TRUE

FALSE

3. In the sorting of cards, the objective is usually to: Sort the cards in a particular order in the fastest amount of time

Sort the cards in no particular order in a short amount of time

Sort the cards in a particular order in the slowest time

4. In which of the following situations would an efficient sorting algorithm be particularly important?

When sorting a list with a million elements

When sorting a single element list

When sorting a small list of four or less elements

When sorting a list that had exactly two elements

5. Sorting the following list in "ascending" order would result in: >> A, B, C, D
`List: B, D, A, C`

FALSE

TRUE

6. Which of the following is not a type of sorting algorithm
```Bubble Sort
Merge Sort
Insertion Sort
Bucket Sort
Quick Sort
Heap Sort
Shell Sort
CPU Sort```

CPU Sort

Insertion Sort

Merge Sort

Bubble Sort

7. The following animation is demonstrating a …. Linear Search

Bubble Sort

Merge Sort

Insertion Sort

8. The following animation is illustrating a …. Bubble Sort

Linear Search

Insertion Sort

Merge Sort

9. The following animation is demonstrating the working of a ... Linear Search

Bubble Sort

Merge Sort

Insertion Sort

10. In the following code for the insertion sort, what is 'nlist' referring to?
```def insertionSort(nlist):
for index in range(1,len(nlist)):

currentvalue = nlist[index]
position = index

while position>0 and nlist[position-1]>currentvalue:
nlist[position]=nlist[position-1]
position = position-1

nlist[position]=currentvalue

nlist = [14,46,43,27,57,41,45,21,70]
insertionSort(nlist)
print(nlist)```

The list of numbers to be sorted

n' random numbers in any given list

The length of the list as 'n'

The first number in the list