Preview

04 - Sorting Algorithims Overview

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

  puts elements of a list in a certain order.

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

  searches for lists and sorts the answers

  None of these answers apply

 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

  FALSE

  TRUE

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

  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

  None of these answers apply

 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 single element list

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

  Bubble Sort

  Insertion Sort

  Merge Sort

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

  Bubble Sort

  Insertion Sort

  Merge Sort

  Linear Search

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

  Insertion Sort

  Merge Sort

  Linear Search

  Bubble Sort

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

  Linear Search

  Merge Sort

  Insertion Sort

  Bubble 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 length of the list as 'n'

  n' random numbers in any given list

  The list of numbers to be sorted

  The first number in the list