Which has the largest time to compute?
O(1)
O(N)
O(log n)
Given the following lines of code pseudocode;
N = 7 FOR i = 1 TO N: output(i)
O(N)
O(n^2)
O(1)
Given the following lines of code pseudocode;
N = 7 FOR i = 1 TO N: FOR j = 1 TO N: output(N)
O(n^2)
O(1)
O(N)
Given the following lines of code pseudocode:
N = 37 FOR i = 1 TO N: j = 1 WHILE j < 10: output(j*N) j = j + 1
O(n^2)
O(N)
O(1)
Given the following lines of code pseudocode:
N = 10 FOR i = 1 TO 5: FOR j = 1 TO i: output(i*j)
O(n^2)
O(1)
O(Log N)
Given the following lines of code pseudocode:
output(N)
N = 7 FOR i = 1 TO N: FOR j = 1 TO N: output(N)
O(1)
O(N)
O(n^2)