public static void main(String args[]){
        LongestPalindromicSubsequence lps = new LongestPalindromicSubsequence();
        String str = "agbdba";
        int r1 = lps.calculateRecursive(str.toCharArray(), 0, str.length());
        int r2 = lps.calculate1(str.toCharArray());
        System.out.print(r1 + " " + r2);
    }
Date 08/01/2014
@author Tushar Roy

Given a string find longest palindromic subsequence in this string.

Time complexity - O(n2)
Space complexity - O(n2

Youtube link - https://youtu.be/_nCsPn7_OgI

References
http://www.geeksforgeeks.org/dynamic-programming-set-12-longest-palindromic-subsequence/
src/com/interview/dynamic/LongestPalindromicSubsequence.java