Consider the following function. Function F(n, m: integer): integer; begin if…
PYQ GATE 1997
Consider the following function.
Function F(n, m: integer): integer;
begin
if (n <= 0) or (m <= 0) then F := 1
else F := F(n - 1, m) + F(n, m - 1);
end;Use the recurrence relation C(n, k) = C(n − 1, k) + C(n − 1, k − 1) to answer the following questions. Assume that n and m are positive integers. Write only the answers without any explanation.
(a) What is the value of F(n, 2)?
(b) What is the value of F(n, m)?
(c) How many recursive calls are made to F, including the original call, when evaluating F(n, m)?
Sign up free to check your answer
Sign up freeLoading lesson…

