Example: Measuring Time Complexity - Single loop
Let’s now calculate the running time complexity of a more complex program. We will split the code into individual operations and then compute the number of iterations.
Simple for loop of size
Here is an example of a simple loop of size n: