longest palindrome subset Algorithm

In computer science, a problem is say to have optimal substructure if an optimal solution can be constructed from optimal solutions of its subproblems. In the application of dynamic programming to mathematical optimization, Richard Bellman's principle of Optimality is based on the idea that in order to solve a dynamic optimization problem from some beginning period t to some ending period T, one implicitly has to solve subproblems beginning from later dates s, where t < s < T. This is an example of optimal substructure.

longest palindrome subset source code, pseudocode and analysis