Opening the reading…
Opening the reading…
CODE DRILL 2 · RUN ONLY
This is a scratch drill — your code runs, nothing is graded or recorded. No test cases, no expected output, no verdict.
TASK
Implement selection sort for [29, 10, 14, 29, 13]. Count every value comparison and every value-changing swap, then print the sorted array and verify that the counts are 10 comparisons and 2 value-changing swaps.
OUTPUT
Sample[10, 13, 14, 29, 29] comparisons: 10 value-changing swaps: 2 verified: true
What a finished answer prints, from the lesson. Nothing has run yet — press Run and this is replaced by your program’s own output.