Q. 9 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); }
Answer: (D)
Explanation:
Q. 9 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); }
Answer: (D)
Explanation: