Skip to content
Related Articles

Related Articles

UGC-NET | UGC NET CS 2017 Jan – III | Question 24
  • Last Updated : 05 Apr, 2018
GeeksforGeeks - Summer Carnival Banner

A recursive function h, is defined as follows :

h(m) = k, if m = 0
     = 1, if m = 1
     = 2 h(m – 1) + 4h(m – 2), if m ≥ 2

If the value of h(4) is 88 then the value of k is :
(A) 0
(B) 1
(C) 2
(D) -1


Answer: (C)

Explanation: According to given question:

     h(4) = 88
       88 = 2 h(3) + 4 h(2)
          = 2 [2 h(2) + 4 h(1)] + 4 h(2)
          = 8 h(2) + 8 h(1)
          = 8 (2 + 4 k) + 8
          = 24 + 32 k
 i.e.   k = 2

So, option (C) is corrct.


Quiz of this Question

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :