0
Hello everyone, help me figure it out
How to understand such an expression in programming languages . Thanks T(n) = { o(1) , if n = 1 2T (n/2) + o(n), if n > 1
1 Answer
+ 2
function o(n) {
// codes here...
}
function T(n) {
if(n==1)
return o(1);
else if(n>1)
return 2*T(n/2)+o(n);
}
looking at the code snippets you've pasted in your question it seems like some "tail recursion" is going on.