DSA 5.56 : tree recursion

PHOTO EMBED

Fri Mar 10 2023 07:28:02 GMT+0000 (Coordinated Universal Time)

Saved by @saakshi #c++

#include <iostream>
using namespace std;

void fun(int n)
{
    if(n>0)
    {
        cout << n << " ";
        fun(n-1);
        fun(n-1);
    }
}

int main() 
{
    fun(3);
    return 0;
}
content_copyCOPY