To determine the complexity of an algorithm is to try to estimate how much space (memory) and time is used overall during the computation or program execution.
Chapter 3, Principles of Algorithm Design, presents more comprehensive coverage of the subject matter on complexity. We will summarize what we learned there here.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.