Activity 01
Pair Programming: Implement Basic Quicksort
Pairs write quicksort using first-element pivot, test on small arrays, then swap pivot to random and compare run times. Discuss observations before sharing with class. Extend to trace recursion on paper.
Evaluate the impact of pivot selection on Quicksort's performance.
Facilitation TipFor Pair Programming: Implement Basic Quicksort, circulate to ensure both partners contribute to the code and understand each step of the partition function.
What to look forProvide students with a small, unsorted array (e.g., [5, 2, 8, 1, 9]). Ask them to trace the first partitioning step of Quicksort using the first element as the pivot, showing the resulting array and the two sub-arrays.