Knowing that O(n^2) > O(nlogn) > O(n) > O(sqrt(n)) > O(logn) > O(1)
and having below python code:
import math
def f1(n=9):
return math.sqrt(n)
def f2(n=10):
return [math.sqrt(i) for i in range(n)]
- Am I correct to infer that O(f1(n)) = O(1)
- Am I correct to infer that O(f1(n)) = O(n)