Activity 01
Pairs Duel: Brute Force vs Divide and Conquer
Pairs implement both strategies for finding maximum subarray sum. First, code brute force (nested loops), then divide and conquer (recursive splits). Test on sample arrays, record runtimes, and graph results for class shareout.
Compare the strengths and weaknesses of different algorithm design strategies.
Facilitation TipDuring Pairs Duel, assign identical small problems to both partners but specify different strategies (brute force vs divide and conquer) to force direct comparison of code and runtime.
What to look forPresent students with three short problem descriptions (e.g., finding the shortest path in a small graph, sorting a list of numbers, finding all possible combinations of items). Ask them to identify which algorithm design strategy (brute force, divide and conquer, greedy, dynamic programming, backtracking) would be most appropriate for each problem and briefly justify their choice.