Lesson 1 of 4
Animated idea model
arrayAlgorithms consume memory as well as time.
Algorithms consume memory as well as time. Space complexity describes how extra memory grows with n. The input itself is not counted when we say extra space.
Your call · An algorithm creates no new collection and keeps only one counter. What is its extra space?