1.

In which of the following problems recurrence relation holds?(a) Optimal substructure(b) Tower of Hanoi(c) Hallmark substitution(d) Longest common subsequenceThis question was addressed to me in an interview for internship.The query is from Recursion in chapter Induction and Recursion of Discrete Mathematics

Answer»

Correct choice is (B) Tower of Hanoi

To explain: We can have recurrence RELATION for tower of hanoi and that is hn = 2 hn-1 + 1h1 = 1, for n NUMBER of disks in one peg.



Discussion

No Comment Found

Related InterviewSolutions