Solution: Big (O) of a Nested Loop with Subtraction
This review provides a detailed analysis of the different ways to solve the nested loop with a subtraction challenge.
We'll cover the following...
We'll cover the following...
Given code
Solution breakdown
On line 8, in the outer loop, int var=n; runs once, var>=1; gets executed times, and var-=3 executed times. In the inner loop, int j=n; gets executed times in total, j>=0; executes times, and j=j-1 gets executed ...