viewing paste recursive relation | C++

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/* O(n) */
#include <iostream>
 
void fct(int x)
{
    if( x == 1 )
        return;
    else
    {
        std::cout << "line\n";
        fct(x/2);
        fct(x/2);
    }
}
 
int main()
{
    fct(64);
    return 0;
}
Viewed 1601 times, submitted by Streusel.