Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 284 Bytes

README.md

File metadata and controls

15 lines (13 loc) · 284 Bytes

Programming-Concept

Content-->Convert the function to a non-recursive function using the simulating recursion method using stack.
int F(int n)
{
    if(n<=1) return 1;
    int a=n+F(n-1);
    int b=n*F(n/2);
    int c=n-2-(a+b)%2;
    int d=F(c);
    return a+b+d;
}