Data structures and algorithms · Counting steps
Counting steps
Two correct answers can differ by a factor of a thousand. · 10 minutes
Everything so far asked one question: is the answer right? From here on there is a second: how much work did it take to get there?
start8 counts it for you. Every line Python executes is one step, and the number is shown after every run. It is a stand-in for time that does not depend on how fast your laptop is.
Predict first
A function compares every item in a list with every other item. With 10 items it takes about 100 steps. About how many with 1,000 items?