What is the time complexity of the following recursive function
int DoSomething(int n){ if(n<=2) return 1; else return (DoSomething(floor(sqrt( n) )) + n); } Options are:-
- O(n^2)
- O(n log n) //all logs are with base 2
- O(log n )
- O(log log n )
What is the time complexity of the following recursive function
int DoSomething(int n){ if(n<=2) return 1; else return (DoSomething(floor(sqrt( n) )) + n); } Options are:-