## P01: a. true b. true c. true d. false e. false ## P02: __growth rates: 1 slowest, 6 fastest__ ![alt text](P02_order.png) ## P03: ![alt text](o_n_square.png) + ![alt text](o_1.png) => ![alt text](o_n_square.png) ## P04: ![alt text](o_log_n.png) ## P05: ```python def myFunction(n): for i in range(n): # O(n) for j in range(i, i * i): # O(i^2 - i) => O(n^2 - n) => O(n^2) if j % i == 0: # O(1) # Check if j is divisible by i for k in range(j): # O(n!) print("*", end="") # Print '*' to the console without newline print() # Example usage myFunction(5) ``` steps behind analysis n = 5 => 5+10+15+20 => 5(1+2+3+4) ~ 5! # actual 5! - 5 n = 4 => 4+8+16 => 4(1+2+3) ~ 4! # actual 4! - 4 n = 3 => 3 => 3(1) ~ 3! # actual 3! - 3 so worse case scenario is O(n + n^2 + 1 + n!) => O(n!)