I need help understanding how to breakdown this function so I can know how to get to the answer of the questions being asked? I know the order of growth but still have some doubts about how to read this on an algorithm?
What is the big O complexity of the following function?
def complexity(n):
k = 0
for i in range(2, n):
for j in range(n, 2*n):
k= k+1
- (a) complexity1: O(n3)
- (b) complexity1: O(n2)
- (c) complexity1: O(n)
- (d) complexity1: O(nlogn)
- (e) None of the above