Preview

04 - Sorting Algorithims Overview

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

  searches for lists and sorts the answers

  None of these answers apply

  puts elements of a list in a certain order.

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

 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.
algorithms_sorting_q1.png

  TRUE

  FALSE

 3. In the sorting of cards, the objective is usually to:
algorithms_sorting_q2.jpg

  None of these answers apply

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

  Sort the cards in a particular order in the fastest 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 that had exactly two elements

  When sorting a list with a million elements

  When sorting a single element list

  When sorting a small list of four or less elements

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

  TRUE

  FALSE

 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

  Bubble Sort

  CPU Sort

  Merge Sort

  Insertion Sort

 7. The following animation is demonstrating a ….
algorithms_sorting_q3.gif

  Insertion Sort

  Merge Sort

  Linear Search

  Bubble Sort

 8. The following animation is illustrating a ….
algorithms_sorting_q4.gif

  Merge Sort

  Insertion Sort

  Linear Search

  Bubble Sort

 9. The following animation is demonstrating the working of a ...
algorithms_sorting_q5.gif

  Bubble Sort

  Linear Search

  Insertion Sort

  Merge 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)

  n' random numbers in any given list

  The list of numbers to be sorted

  The first number in the list

  The length of the list as 'n'