UGC-NET Jan 2017 · Arrays & Matrix Representation

MCQ · 2 marks · Problem PROG-DSTR-0035

A recursive function $h$, is defined as follows: $\begin{array} {} h(m) & =k, \text{if  } m=0 \\  &=1, \text{if } m=1 \\  &=  2 h(m-1)+4h(m-2), \text{if } m \geq 2 \end{array}$ If the value of $h(4)$ is $88$ then the value of $k$ is:
  1. A
    $0$
  2. B
    $1$
  3. C
    $2$
  4. D
    $-1$

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionExpand the recurrence \(h(m)=2h(m-1)+4h(m-2)\) with \(h(0)=k,\ h(1)=1\):\[h(2)=2(1)+4k=2+4k,\]\[h(3)=2(2+4k)+4(1)=8+8k,\]\[h(4)=2(8+8k)+4(2+4k)=24+32k.\]Set \(24+32k=88\):\[32k=64\ \Rightarrow\ k=2.\]Answer: C

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com