Preview

04 - Sorting Algorithims Overview

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

  None of these answers apply

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

  puts elements of a list in a certain order.

  searches for lists and sorts the answers

 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 a particular order in the slowest time

  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

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

  When sorting a small list of four or less elements

  When sorting a list that had exactly two elements

  When sorting a single element list

  When sorting a list with a million 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

  CPU Sort

  Insertion Sort

  Bubble Sort

  Merge Sort

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

  Linear Search

  Insertion Sort

  Merge Sort

  Bubble Sort

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

  Insertion Sort

  Bubble Sort

  Merge Sort

  Linear Search

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

  Insertion Sort

  Merge Sort

  Bubble Sort

  Linear Search

 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 first number in the list

  n' random numbers in any given list

  The length of the list as 'n'

  The list of numbers to be sorted