Computer scienceAlgorithms and data structuresIntro to algorithms and data structuresUnderstanding algorithms and complexity analysis

Time and memory complexity

Analysis Matters

Report a typo

Apart from the theory, you also need to understand how to apply your knowledge correctly when defining an algorithm's complexity.
Below, you'll see simple analysis steps of the algorithm. Arrange them in the correct order.

Put the items in the correct order
Among all the components, identify the dominant one.
Determine all time complexity components.
Simplify the complexity of the dominant component.
Repeat steps above for space complexity.
Check if this time and spaces complexities fit for the problem's conditions.

Create a free account to access the full topic