def exercise2(N):
count=0
i = N
while ( i > 0 ):
for j in range(0,i):
count = count + 1
i = i//2
How do we know the time complexities for both the while and for loop? Edit:Many of the users are sending me link to understand the time complexity using Big-OH analysis. I appreciate it but the only languages in CS i understand is python and all those explanations are using java and C++ which makes it hard for me to understand. If anyone could explain time complexity using python it would be great!