Average Case
Expected cost over typical inputs — Θ(n).
INSTRUCTION
MEMORY
CONSOLE
MEMORY — every variable is a labeled box
(empty — no variables created yet)
CONSOLE — what the program says back
>▍ nothing printed yet
Expected cost over typical inputs — Θ(n).
MEMORY — every variable is a labeled box
CONSOLE — what the program says back