Intro to Algorithm

Time and space complexity - basic knowledge

It is better to have low time complexity and space complexity. But in many cases, we have to choose either one to solve our problem. Sacrificing one rather achieving both goal (goal of making minimum TC and SC) may be necessary but don’t worry that much now as a beginner. Focus on your logic building and Approach of solving problems.