Answer It in One Step: Trading Memory for Time

Answer "how long are the first few songs?" in one step instead of a loop, by spending a little memory on running totals, and measure both sides of that trade in Big-O: time complexity and space complexity.

Updated

Cheat sheet: Answer It in One Step: Trading Memory for Time
Category
Data Structures
Level
Apprentice
Tags
software-development, Space Complexity, Time Complexity, Trade-Off