Question: (4 marks) Consider the following recursive algorithm Fct(n) which can take any integer n0 as input. begin{tabular}{l} hline Algorithm 1Fct(n) hline 1: if n3

 (4 marks) Consider the following recursive algorithm Fct(n) which can takeany integer n0 as input. \begin{tabular}{l} \hline Algorithm 1Fct(n) \\ \hline 1:

(4 marks) Consider the following recursive algorithm Fct(n) which can take any integer n0 as input. \begin{tabular}{l} \hline Algorithm 1Fct(n) \\ \hline 1: if n3 then \\ 2: return 1 \\ 3: else \\ 4: return Fct(n2)+2Fct(n3)+2n \\ 5: end if \end{tabular} Let W(n) be the number of multiplications () done in a call to Fct(n). Which of the following expressions describes W(n) ? Let W(n) be the number of multiplications () done in a call to Fct(n). Which of the following expressions describes W(n) ? W(n)=1 for n3, and W(n)=W(n2)+2W(n3) for n>3 All other answers are wrong. W(n)=0 for n3, and W(n)=W(n2)+W(n3)+2 for n>3 W(n)=0 for n3, and W(n)=W(n2)+W(n3) for n>3 W(n)=1 for n3, and W(n)=W(n2)+2W(n3)+2n for n>3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!