NEW
Font size
WorksheetsSorting Algorithms Quiz
Total questions: 21
Worksheet time: 11mins
What causes Merge Sort to require O(n) auxiliary space?
Deep recursion
Temporary arrays during merging
Pointer swaps
Tree height growth
Which sorting algorithm is both in-place and stable under its standard implementation?
Bubble Sort
Merge Sort
Quick Sort
Selection Sort
You are sorting a list that is already almost sorted. Which algorithm will run fastest in this situation?
Merge Sort
Quick Sort
Insertion Sort
Selection Sort
A sorting algorithm swaps elements even when they are already in correct order. Which algorithm does this describe?
Merge Sort
Bubble Sort
Selection Sort
Insertion Sort
Quick Sort using recursion has worst-case space complexity of:
O(log n)
O(n)
O(n log n)
O(1)on Sort
Which sorting algorithm can be improved using a flag to detect whether the list is already sorted?
Merge Sort
Selection Sort
Insertion Sort
Bubble Sort
A teacher wants to explain Divide-and-Conquer. Which algorithm is the BEST demonstration?
Bubble Sort
Merge Sort
Insertion Sort
Linear Search
Binary Search fails to produce correct results when applied to:
A sorted array
A sorted linked list
An unsorted array
A sorted list in descending order
In Quick Sort, the worst-case occurs when:
The pivot is always the middle element
All elements are unique
The pivot is always the smallest or largest
The array size is a prime number
Which algorithm minimizes the number of swaps the most?
Selection Sort
Bubble Sort
Insertion Sort
Quick Sort
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?
4
3
6
5
Which search method is guaranteed to check every element in the worst case?
Binary Search
Interpolation Search
Linear Search
Fibonacci Search
You are sorting a list that is already almost sorted. Which algorithm will run fastest in this situation?
Insertion Sort
Merge Sort
Quick Sort
Selection Sort
Which sorting algorithm is most suitable when data arrives continuously and needs to remain sorted as new elements are inserted?
Insertion Sort
Merge Sort
Quick Sort
Selection Sort
Which sorting algorithm is considered out-of-place and also stable?
Selection Sort
Merge Sort
Quick Sort
Bubble Sort
A list contains many duplicate values. Which algorithm performs worst because it makes unnecessary comparisons?
Insertion Sort
Merge Sort
Selection Sort
Quick Sort
Binary Search reduces the search space by:
Removing one element at a time
Partitioning into three segments
Halving the remaining elements
Sorting while searching
Which algorithm can terminate early if the list becomes sorted during execution?
Merge Sort
Selection Sort
Bubble Sort
Quick Sort
Which sorting algorithm has the lowest number of data movements, making it suitable for systems with costly write operations?
Merge Sort
Bubble Sort
Insertion Sort
Selection Sort
If each write operation to storage is expensive and should be minimized, which sorting algorithm is the most suitable?
Selection Sort
Merge Sort
Bubble Sort
Merge Sort
Which algorithm requires data to be sorted BEFORE it can be applied?
Linear Search
Binary Search
Depth-first Search
Selection Sort
