Section 1: Big O

Big O

Big O Worst Case

Big O: O(N)

def print_items(n):
    for i in range(n):
        print(i)
        
print_items(10)

-Example of O(n)

-we passed the number n and then in ran n times

-n was the number of operation

image.png

-horizontal axis(purple) is N or input size

-vertical axis(red) is number of operation

-Graph: straight line, proportional to n

-O of N is always straight line or proportional