...

/

Solution: Big O of Nested Loop with Addition

Solution: Big O of Nested Loop with Addition

This review provides a detailed analysis of the time complexity of the Nested Loop with Addition problem.

We'll cover the following...

Solution #

Press + to interact
n = 10 # n can be anything, this is just an example
sum = 0
pie = 3.14
for var in range(1, n, 3):
print(pie)
for j in range(1, n, 2):
sum += 1
print(sum)

The line for var in range(1,n,3): gets executed ...

Access this course and 1400+ top-rated courses and projects.