# Bubble Sort MCQ Quiz

10 Questions | Attempts: 13003  Settings  Here is an amazing Bubble sort Quiz. You can also call it a selection sort quiz. This Quiz is to check your knowledge of the Bubble sort algorithm or selection sort algorithm. If you think you understand enough about the Bubble sort algorithm and you can pass this test with a good score, then try your luck here. If you manage to get 80 or above in this selection sort quiz, that would be excellent—best of luck with your test here.

• 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
• A.

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

• B.

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

• C.

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

• D.

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

• 2.
In a bubble sort structure, there is/are?
• A.

A single for loop

• B.

Three for loops, all separate

• C.

A while loop

• D.

Two for loops, one nested in the other

• 3.
What is the maximum number of comparisons if there are 5 elements in array x?
• A.

10

• B.

2

• C.

5

• D.

25

• 4.
What is the max number of comparisons that can take place when a bubble sort is implemented? Assume there are n elements in the array?
• A.

(1/2)(n-1)

• B.

(1/2)n(n-1)

• C.

(1/4)n(n-1)

• D.

None of the above

• 5.
What are the worst case and best case time complexity of bubble sort consequently?
• A.

O(n), O(n2)

• B.

O(n2), O(n3)

• C.

O(n), O(n3)

• D.

None of the above

• 6.
Which one of the following is the first step in a selection sort algorithm?
• A.

The minimum value in the list is found.

• B.

The maximum value in the list is found.

• C.

• 7.
How many passes/scans will go through a list of 10 elements?
• A.

3

• B.

5

• C.

7

• D.

9

• 8.
Bubble sorting got its name from a Bubble gum company that used it for the first time.
• A.

True

• B.

False

• 9.
How many passes (or "scans") will there be through a list being sorted using a selection sort?
• A.

Array_size*2

• B.

Array_size+1

• C.

Array_size-1

• D.

None of the above

• 10.
When using Bubble sort, what number of swappings are required to sort the numbers 8,22,7,931,5,13 in ascending order?
• A.

5

• B.

10

• C.

12

• D.

14

## Related Topics Back to top
×

Wait!
Here's an interesting quiz for you.