DSA SheetLesson · no judge

CODE DRILL 1 · RUN ONLY

Write it, run it, read the output

This is a scratch drill — your code runs, nothing is graded or recorded. No test cases, no expected output, no verdict.

TASK

Implement insertion sort for the array [5, 2, 4, 6, 2, 3]. Save each key, shift larger values to the right, place the key in the hole, and print the array after each of the five outer passes.

C++
Loading editor…

OUTPUT

Sample
2 5 4 6 2 3 
2 4 5 6 2 3 
2 4 5 6 2 3 
2 2 4 5 6 3 
2 2 3 4 5 6 

What a finished answer prints, from the lesson. Nothing has run yet — press Run and this is replaced by your program’s own output.

Next part · Code drill 2