Activity 01
Experiment Lab: Pivot Strategy Showdown
Groups implement Quick Sort with three different pivot strategies (first element, random element, median-of-three) and measure performance on sorted, reverse-sorted, and random arrays. Groups report their timing data to the class and together identify which strategy is most robust.
Differentiate between Merge Sort and Quick Sort in terms of their approach and performance characteristics.
Facilitation TipDuring the Pivot Strategy Showdown, have students run each pivot method on the same dataset three times to observe variance in partition sizes and step counts.
What to look forProvide students with a small, unsorted array (e.g., [5, 2, 8, 1, 9, 4]). Ask them to: 1. Choose the first element as the pivot and show the array after one partitioning step. 2. Identify the pivot selection strategy that would lead to O(n^2) complexity for this array and explain why.