1.

Given a string, you have to find the minimum number of characters to be inserted in the string so that the string becomes a palindrome. Which of the following methods can be used to solve the problem?(a) Greedy algorithm(b) Recursion(c) Dynamic programming(d) Both recursion and dynamic programmingI have been asked this question during an interview.My enquiry is from Minimum Insertions to form a Palindrome topic in section Dynamic Programming of Data Structures & Algorithms II

Answer»

The CORRECT answer is (d) Both recursion and DYNAMIC programming

Easy explanation - Dynamic programming and recursion can be USED to SOLVE the problem.



Discussion

No Comment Found

Related InterviewSolutions