CS: Merge Sort and Quick Sort Algorithms
Comparing divide-and-conquer sorting strategies
Comparing divide-and-conquer sorting strategies
CS - Grade 9-12
- 1
Trace one full merge sort on the array [8, 3, 5, 1]. Show how the array is split and then merged into sorted order.
- 2
Trace the partition step of quick sort on the array [6, 2, 8, 4, 1] using 6 as the pivot. Write the values that should go to the left and right of the pivot after partitioning.
- 3
Explain why merge sort is called a divide-and-conquer algorithm.
- 4
For the array [9, 7, 5, 3, 1], suppose quick sort always chooses the first element as the pivot. Explain why this is a poor pivot choice for this array.
- 5
What is the worst-case time complexity of merge sort, and why does it have that complexity?
- 6
What is the worst-case time complexity of quick sort, and what type of partitioning causes it?
- 7
Compare the extra memory usage of merge sort and quick sort in a typical array implementation.
- 8
The array [4, 1, 6, 2, 5, 3] is being sorted using merge sort. After the array is split into [4, 1, 6] and [2, 5, 3], what are the sorted versions of those two halves before the final merge?
- 9
Merge the two sorted lists [2, 6, 9] and [1, 5, 7, 10]. Show the final sorted list.
- 10
A quick sort implementation chooses a random pivot. Explain one reason this can improve performance compared with always choosing the first element.
- 11
A sorting algorithm is stable if equal values keep their original relative order. Is standard merge sort usually stable, and why?
- 12
You need to sort a very large array, and you want guaranteed O(n log n) worst-case time. Between merge sort and quick sort, which would you choose and why?
More CS Worksheets
CS: Algorithms and Flowcharts
Grade 6-8 · 12 problems
CS: Arrays and Lists
Grade 9-12 · 12 problems
CS: Big-O Notation and Algorithm Efficiency
Grade 9-12 · 12 problems
CS: Binary Numbers and Number Systems
Grade 6-8 · 12 problems
More Grade 9-12 Worksheets
Linear Equations
Math · 8 problems
Cell Biology
Biology · 8 problems
Reading Comprehension
Language Arts · 8 problems
Historical Thinking & Evidence
Social Studies · 8 problems