retagged by
4,471 views
0 votes
0 votes
Consider a situation where you don’t have function to calculate power (pow( ) function in C)

and

you need to calculate x^n where x can be any number and n is a positive integer. What can

be the best possible time complexity of your power function?

(a) O (n)

(b) O (n log n)

(c) O(log log n)

(d) O (log n)
retagged by

1 Answer

Related questions

0 votes
0 votes
1 answer
1
Naveen Pandey asked Jan 8, 2017
502 views
T(n)=2T(log n)+c c is a constant. Base condition is if(n<2) return 1What will be the tightest bound on time complexity?
4 votes
4 votes
3 answers
2
0 votes
0 votes
3 answers
3
shikharV asked Nov 17, 2015
2,083 views
Given answer: BPlease explain
1 votes
1 votes
1 answer
4
shikharV asked Nov 15, 2015
1,029 views
The answer to the above problem is A but I am expecting it to be D as constant amount of work is required to solve each subproblem.