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 analyze for A = [6, 2, 9, 1] and n = 4. Count the scan, nested, and doubling phase iterations, then print the returned total and the three counts.

C++
Loading editor…

OUTPUT

Sample
returned total: 27
scan iterations: 4
nested iterations: 6
doubling iterations: 2

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