Letā€™s dive deeper into the time complexity analysis by looking at some examples.

Example 1: for loop

The case below is a for loop. We have a time complexity of O(n)O(n).

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.