Main Thread

בסעיף 2, צריך להתייחס בנפרד ל - nים קטנים מ - 10**5 ו - nים גדולים מ - 10**5? או שמספיק לתת את הסיבוכיות עבור n0=10**5?

תודה

What is the complexity of the function len? can we assume it's O(1)?

Yes. Python's list maintains it's length so len() is indeed O(1)

At a certain point, the inner loop (k) might not run at all. Should we still count the middle loop (j) as an O(1) even if the k loop does not run? I mean, is j+=1 counts as an action with O(1)?

would it be correct to assume that in case j>=(10^5+1):

Then the loop:

for k in range(10**5, j, -5): print(i)

would run in O(0), no operation takes place, only the condition for the function is checked and there is no print…

Note that checking the condition takes O(1).

In this case (when j>=(10^5+1) ) there are no loop iterations

suppose a function recieve a number (n) and prints "hello" (one time) if n <10^5, and prints n times "hello" if n>=10^5.

assuming each time "hello" is printed takes O(1).

does the complexity of this function is O(n)?

yes, since O(…) is an asymptotic notion. We care only about large n's.