1.

Every recursive algorithm must have the problem of ________(a) overhead of repeated function calls(b) collision of different function calls(c) searching for all duplicate elements(d) make only two recursive callsThis question was addressed to me in final exam.Question is from Recursion topic in chapter Induction and Recursion of Discrete Mathematics

Answer» RIGHT choice is (a) overhead of REPEATED FUNCTION calls

To elaborate: Due to the overhead of repeated function calls and returns, recursive ALGORITHMS may be inefficient for small data. Any recursion can be replaced by iteration with an explicit CALL stack whereas iteration can be replaced with tail recursion.


Discussion

No Comment Found

Related InterviewSolutions