mardi 5 octobre 2021

What would be the solution to this? [closed]

Consider the following C function.

int fun ( int n ) {

   int x = 1, k ;

   if ( n == 1) return x ;

   for( k = 1 ; k < n ; ++ k )

       x = x + fun( k ) * fun( n - k ) ;

   return x ;

}

The return value of fun (5) is ________.

I tried finding some videos but couldn't find one, and I know I need to study more and clear my concepts properly first, but this is not homework and I also found an answer on geekforgeeks but I couldn't understand it properly, so I thought someone here might give me a better explanation. This is a question from GATE 2014.

Aucun commentaire:

Enregistrer un commentaire