codezonediitj / pydatastructs

A python package for data structures and algorithms
https://pydatastructs.readthedocs.io/en/stable/
Other
200 stars 267 forks source link

Longest common subsequence #308

Closed khushibalyan220101 closed 3 years ago

khushibalyan220101 commented 3 years ago

Description of the problem LCS Problem Statement: Given two sequences, find the length of longest subsequence present in both of them. A subsequence is a sequence that appears in the same relative order, but not necessarily contiguous. Example of the problem For example, “abc”, “abg”, “bdf”, “aeg”, ‘”acefg”, .. etc are subsequences of “abcdefg”.

khushibalyan220101 commented 3 years ago

@czgdp1807 sir I wanna contribute with this problem by creating a specific file for dynamic programming problems so that other important questions can be collected in a particular file.

czgdp1807 commented 3 years ago

This can go to the existing file, linear_data_structures.algorithms under pydatastructs since the algorithm you are suggesting is specific to linear data structures. Please go through the README for better understanding the workflow before submitting a PR. P.S. I hope LCS is applicable to any kind of linear sequences and not necessarily strings.

khushibalyan220101 commented 3 years ago

Sure sir, I will go through the README.

LazarusCoder commented 3 years ago

LCS with BackTracking added in linerstruture->algorithms.py Test cases Added too "Fixes #310 "