Insertion Sort Quiz Questions And Answers

10 Questions | Attempts: 10187

SettingsSettingsSettings
Insertion Sort Quiz Questions And Answers - Quiz

Do you know what an insertion sort is? Here's an interesting Insertion Sort Quiz to test your knowledge. It is a simple sorting algorithm that builds the final sorted array one item at a time. This algorithm works similarly to the sorting of playing cards in hands. If you think you have a good understanding of insertion sort, then you must try this quiz and see if you can pass this test or not. If you score more than 70%, it means that you've passed this quiz. So, get ready to start the quiz!


Questions and Answers
  • 1. 
    What are the correct intermediate steps of the following data set when it is being sorted with the Insertion sort? 15,20,10,18
    • A. 

      15,20,10,18 -- 10,15,20,18 -- 10,15,18,20 -- 10,15,18,20

    • B. 

      15,18,10,20 -- 10,18,15,20 -- 10,15,18,20 -- 10,15,18,20

    • C. 

      15,10,20,18 -- 15,10,18,20 -- 10,15,18,20

    • D. 

      10, 20,15,18 -- 10,15,20,18 -- 10,15,18,20

  • 2. 
    What will be the number of passes to sort the elements using insertion sort? 14, 12,16, 6, 3, 10
    • A. 

      7

    • B. 

      8

    • C. 

      1

    • D. 

      5

  • 3. 
    Which of the following options contain the correct feature of an insertion sort algorithm?
    • A. 

      Dependable

    • B. 

      Stable, adaptive

    • C. 

      Anti-stable

    • D. 

      None of the above

  • 4. 
    State true or false. Binary search can be used in an insertion sort algorithm to reduce the number of comparisons.
    • A. 

      True

    • B. 

      False

  • 5. 
    Which of these sorting algorithms is the fastest for sorting small arrays?
    • A. 

      Insertion sort

    • B. 

      Quick sort

  • 6. 
    Which of these is not a stable sorting algorithm in its typical implementation?
    • A. 

      Merge sort

    • B. 

      Quick sort

    • C. 

      Insertion sort

    • D. 

      None of the above

  • 7. 
    Consider the following lists of partially sorted numbers. The double bars represent the sort marker. How many comparisons and swaps are needed to sort the next number. [1 3 4 8 9 || 5 2]
    • A. 

      2 comparisons, 3 swaps

    • B. 

      3 comparisons, 2 swaps

    • C. 

      4 comparisons, 3 swaps

    • D. 

      3 comparisons, 4 swaps

  • 8. 
    Consider the following lists of partially sorted numbers. The double bars represent the sort marker. How many comparisons and swaps are needed to sort the next number. [1 3 4 5 8 9 || 2]
    • A. 

      5 comparisons, 4 swaps

    • B. 

      4 comparisons, 5 swaps

    • C. 

      6 comparisons, 5 swaps

    • D. 

      5 comparisons, 6 swaps

  • 9. 
    If all the elements in an input array is equal for example {1,1,1,1,1,1}, What would be the running time of the Insertion Algorithm?
    • A. 

      O(2N)

    • B. 

      O(n^2)

    • C. 

      O(n)

    • D. 

      None of the above

  • 10. 
    What operation does the Insertion Sort use to move numbers from the unsorted section to the sorted section of the list? 
    • A. 

      Finding the minimum value

    • B. 

      Swapping

    • C. 

      Finding out an pivot value

    • D. 

      None of the above

Back to Top Back to top
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.