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 examplesum = 0pie = 3.14for var in range(1, n, 3):print(pie)for j in range(1, n, 2):sum += 1print(sum)
The line for var in range(1,n,3):
gets executed ...
Access this course and 1400+ top-rated courses and projects.