00:01
Hello students to compute the overall complexity of the given lines for the code.
00:05
So let's analyze each step by step.
00:08
So here for int i in a range, this loop will run the n times.
00:14
It will run the n times and the next it is applying a condition this it will check with the condition if i is divisible by 3.
00:24
If i is divisible by 3 for every third iteration then the inner loop for which j in a range of 1000.
00:37
So there we will sum of plus 100 sum of sum plus of j.
00:46
So the inner loop has the constant time complexity of the big o of 1000 big o of 1000.
00:54
So which is an effective of big o of 1 which is an effective of big o of 1.
00:59
So for the other iteration that is not divisible by 3 the inner loop that is for j in the range of i plus 1 where the sum plus of sum plus is j the inner loops runs for the 0 to i.
01:15
It will run for the 0 to ith term and has the inner complexity of the big o of i.
01:22
It has the inner complexity of big o of i...