Just-A-Visitor / Algorithmic-Pseudocode

This repository contains the pseudocode(pdf) of various algorithms and data structures necessary for Interview Preparation and Competitive Coding
GNU General Public License v3.0
762 stars 167 forks source link

Pseudocode for Longest Palindromic Subsequence (using DP / LCS) #20

Closed ghost closed 5 years ago

yildirimyigit commented 5 years ago

Hello, I intend to work on this one. Is it OK?

ghost commented 5 years ago

Are you talking about subsequence or substring?

yildirimyigit commented 5 years ago

@Just-A-Visitor can you further explain it please? It says subsequence (using LCS) in the title and I can work on either one but your LCS solution is just for strings if I'm not mistaken.

ghost commented 5 years ago
ghost commented 5 years ago

@yildirimyigit Please test your approach here before moving on to the pseudocode.

You can either use the LCS approach (Hint: Reverse the string). if you are confused, just implement simple DP (Bottom Up or Top Down) and I'll add the solution using LCS later. Maybe this would be better to work on for you!

yildirimyigit commented 5 years ago

I have already had the LCS approach. I am trying to figure out the conventions you use, at the moment.

ghost commented 5 years ago

But make a pull request for your previous code first so that I can review it.

Remember to place it inside Pseudocode/Dynamic Programming/Longest Common Substring/SourceCode.tex Don't put anything else for now (Not even ReadMe)

yildirimyigit commented 5 years ago

I cannot follow you mate. So sorry. To my understanding, you first want me to send you the source code, like the cpp file so that you can chek it against your standards. Only after you make sure that it complies with your standards, then you want me to write the document, SourceCode.tex. Isn't it correct?

So where am I supposed to place the cpp file?

ghost commented 5 years ago

No. I want you to send me the SourceCode.tex file via PR (exactly as you did earlier). But this time, make the name of the folder as Longest Common Substring. (Just send your old source code (Latex) as it is).

Your previous PR was correct (just in the wrong folder). I want you to file that PR again.

ghost commented 5 years ago

Place it inside Pseudocode/Dynamic Programming/Longest Common Substring/SourceCode.tex Don't put anything else for now (Not even ReadMe)

ghost commented 5 years ago

And no, I'm not asking for the source code (CPP), you just have to send the LaTex file. I was talking about the coding standards of LaTex and not CPP. If you're confused, don't worry, just file a PR and I'll suggest changes to your Latex file to show you the conventions I use.

Using the Code Review feature of Github, I can suggest changes in your pseudocode file. This way you can easily pick up the conventions.

yildirimyigit commented 5 years ago

Ok. One last thing. The one I sent you earlier was Longest Palindromic Substring not Longest Common Subsequence. So you want the palindromic substring, right?

ghost commented 5 years ago

Yes, exactly.

yildirimyigit commented 5 years ago

You are one patient guy :smile:

Then again, the title of this issue is "Longest Palindromic Subsequence" and my PR is for Longest Palindromic Substring. We should have opened another issue for that, I guess.

My next PRs won't require this much energy of yours, I promise.

ghost commented 5 years ago

Oh, Don't worry about the title. I'll sort it out. Give me 5 minutes and I'll be done with the review. Then we can merge it.

ghost commented 5 years ago

I've left some comments in your PR. Please go through them.

yildirimyigit commented 5 years ago

Hey, I would like to write the pseudocode for the longest palindromic subsequence (using LCS) problem too. Should I re-fork the project?

ghost commented 5 years ago

No need to fork it again. Just confirm that it shows This branch is even with Just-A-Visitor : Master

ghost commented 5 years ago

You can delete the temporary branch that you would've created. But no need to delete the fork. And make sure that you create a separate branch for each question(as you did right now)

ghost commented 5 years ago

If you create a new branch for each question, you'll have the flexibility to delete the branch (without going through the hassles of deleting your fork) if something goes wrong.

An important point, if the main page shows that your fork is x commits behind my master, just click the pull request option and it will be synced.

yildirimyigit commented 5 years ago

Hey @Just-A-Visitor,

I just wanted to let you know that I created another PR, https://github.com/Just-A-Visitor/Algorithmic-Pseudocode/pull/36 and added the link to the source code for lp_subsequence problem.

ghost commented 5 years ago

36