–1 vote
92 views
What will be the time complexity of a function f(n) = n^-2  i.e. pow (n,-2) ?
asked | 92 views
O(1) ?
How ??
because for $\frac{1}{n^{2}}$ as n grows from 1 onwards, it monotonically decreases and can never exceed a positive constant greater than 1.

+1 vote

f(n) = n-2 = 1/n2= 1/(nxn)  ie f(n) = 1/(nxn)

this can be done in 0(1).

answered by Active (1.1k points)
This is not polynomial function and not in the form of n^k where k is some constant . How we could find the complexity ? Plz elaborate it.
hey...what not use definite integral of function f(n) = 1/n^2 ??.That's a easy way to estimate areas under a function curve..I am getting constant after integrating it..So looks like O(1).