The following C function is an example of what type of recursion? int f(int n)…

BEL · Computer Science · Probationary Engineer · 2023

The following C function is an example of what type of recursion?

int f(int n) { if(n==1) return 1; else if(n==0) return 0; else return(f(n-1)+f(n-2)); }

  1. A.

    Binary

  2. B.

    Tail

  3. C.

    Linear

  4. D.

    Head

Attempted by 701 students.

Show answer

Correct answer: A

The worked solution is available to enrolled students.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…