wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Sorting Algorithms Quiz

Total questions: 21

Worksheet time: 11mins

Name
Class
Date
1.

What causes Merge Sort to require O(n) auxiliary space?

a)

Deep recursion

b)

Temporary arrays during merging

c)

Pointer swaps

d)

Tree height growth

2.

Which sorting algorithm is both in-place and stable under its standard implementation?

a)

Bubble Sort

b)

Merge Sort

c)

Quick Sort

d)

Selection Sort

3.

You are sorting a list that is already almost sorted. Which algorithm will run fastest in this situation?

a)

Merge Sort

b)

Quick Sort

c)

Insertion Sort

d)

Selection Sort

4.

A sorting algorithm swaps elements even when they are already in correct order. Which algorithm does this describe?

a)

Merge Sort

b)

Bubble Sort

c)

Selection Sort

d)

Insertion Sort

5.

Quick Sort using recursion has worst-case space complexity of:

a)

O(log n)

b)

O(n)

c)

O(n log n)

d)

O(1)on Sort

6.

Which sorting algorithm can be improved using a flag to detect whether the list is already sorted?

a)

Merge Sort

b)

Selection Sort

c)

Insertion Sort

d)

Bubble Sort

7.

A teacher wants to explain Divide-and-Conquer. Which algorithm is the BEST demonstration?

a)

Bubble Sort

b)

Merge Sort

c)

Insertion Sort

d)

Linear Search

8.

Binary Search fails to produce correct results when applied to:

a)

A sorted array

b)

A sorted linked list

c)

An unsorted array

d)

A sorted list in descending order

9.

In Quick Sort, the worst-case occurs when:

a)

The pivot is always the middle element

b)

All elements are unique

c)

The pivot is always the smallest or largest

d)

The array size is a prime number

10.

Which algorithm minimizes the number of swaps the most?

a)

Selection Sort

b)

Bubble Sort

c)

Insertion Sort

d)

Quick Sort

11.

Binary Search recursively divides the array in half until one element remains.
For Binary Search on an array of size 32, how many stack frames exist at maximum?

a)

4

b)

3

c)

6

d)

5

12.

Which search method is guaranteed to check every element in the worst case?

a)

Binary Search

b)

Interpolation Search

c)

Linear Search

d)

Fibonacci Search

13.

You are sorting a list that is already almost sorted. Which algorithm will run fastest in this situation?

a)

Insertion Sort

b)

Merge Sort

c)

Quick Sort

d)

Selection Sort

14.

Which sorting algorithm is most suitable when data arrives continuously and needs to remain sorted as new elements are inserted?

a)

Insertion Sort

b)

Merge Sort

c)

Quick Sort

d)

Selection Sort

15.

Which sorting algorithm is considered out-of-place and also stable?

a)

Selection Sort

b)

Merge Sort

c)

Quick Sort

d)

Bubble Sort

16.

A list contains many duplicate values. Which algorithm performs worst because it makes unnecessary comparisons?

a)

Insertion Sort

b)

Merge Sort

c)

Selection Sort

d)

Quick Sort

17.

Binary Search reduces the search space by:

a)

Removing one element at a time

b)

Partitioning into three segments

c)

Halving the remaining elements

d)

Sorting while searching

18.

Which algorithm can terminate early if the list becomes sorted during execution?

a)

Merge Sort

b)

Selection Sort

c)

Bubble Sort

d)

Quick Sort

19.

Which sorting algorithm has the lowest number of data movements, making it suitable for systems with costly write operations?

a)

Merge Sort

b)

Bubble Sort

c)

Insertion Sort

d)

Selection Sort

20.

If each write operation to storage is expensive and should be minimized, which sorting algorithm is the most suitable?

a)

Selection Sort

b)

Merge Sort

c)

Bubble Sort

d)

Merge Sort

21.

Which algorithm requires data to be sorted BEFORE it can be applied?

a)

Linear Search

b)

Binary Search

c)

Depth-first Search

d)

Selection Sort