Activity 01
Pair Programming: Implement Bubble Sort
Pairs write Bubble Sort code for arrays of 10-20 elements. They add print statements to visualize swaps, run on random and sorted data, then discuss swap counts. Extend by modifying for early termination.
Compare the efficiency of Bubble Sort, Selection Sort, and Insertion Sort for small datasets.
Facilitation TipDuring Pair Programming: Bubble Sort, circulate and ask pairs to explain why swapping stops early on a nearly sorted array.
What to look forProvide students with a small array, e.g., [5, 1, 4, 2]. Ask them to trace the steps of Selection Sort, showing the array after each swap. Then, ask them to state the total number of swaps performed.