Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Longest Palindromic Sub-sequence #235

Open
wants to merge 5 commits into
base: master
from

Conversation

@mitali004
Copy link
Contributor

@mitali004 mitali004 commented Dec 16, 2017

ISSUE NUMBER

117

SHORT DESCRIPTION

Added the code for longest palindromic subsequence along with a readme.md for it.

mitali004 added 5 commits Dec 16, 2017

### Filling of the matrix
Every single charecter contributes to a palindromic string of length 1 starting and ending at itself, therefore we fill the diagonal of the
matrix with 1 for every [i][i] entry. <br/><br/>

This comment has been minimized.

@prateekiiest

prateekiiest Dec 24, 2017
Member

make like this [i][i]

For every other entry:<br/>
If last and first characters of str are same, then mat[i][j] = mat[i+1][j-1] + 2, as it considers [2(for the first and the last chaar)] +
[longest palindromic subsequence between these 2 chars].<br/>
Else mat[i][j] = max(mat[i][j-1], mat[i+1][j]).

This comment has been minimized.

@prateekiiest

prateekiiest Dec 24, 2017
Member

similarly add ` before and after

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.