In the previous chapters, we have often spoken about optimizing our code/algorithms and have briefly used the terms space and time complexity and how we want to reduce them. As the name suggests, it is the complexity of the code that we want to keep to a minimum, but what does that entail? What are the different levels of this said complexity? How do we calculate the space and time complexity of an algorithm? These are the questions that we will address in this chapter while discussing the following topics:
- Varying degrees of time complexity
- Space complexity and Auxiliary space