Bubble Sort and Selection Sort Exercises

By: Yohan Hmaiti

Bubble sort algorithm and Selection Sort Algorithm Knowledge Check:

Bubble Sort

  1. What are the correct intermediate steps of the following data set when it is being sorted with the bubble sort? 15,20,10,18
  1. In a bubble sort structure, there is/are?
  1. What is the maximum number of comparisons if there are 5 elements in array x?

Answers for the Bubble sort:

  1. A
  2. D
  3. A

Selection Sort Portion

  1. What are the correct intermediate steps of the following data set when it is being sorted with the Selection sort? 15,20,10,18
  1. In a selection sort structure, there is/are?
  1. Which one of the following is the first step in a selection sort algorithm?

Answers for the selection Sort:

  1. A
  2. C
  3. A