Longest common substring: Difference between revisions
Content added Content deleted
(Explaining the difference between a substring and a subsequence.) |
No edit summary |
||
Line 1: | Line 1: | ||
{{draft task}}Write a program that prompts the user to enter two different strings, and then output their longest common substring. Note that substrings are consecutive characters within a string. This distinguishes them from subsequences, which is any sequence of characters within a string, even if there are extraneous characters in between them. Hence, the longest common subsequence between "thisisatest" and "testing123testing" is "tsitest", whereas the longest common sub''string'' is just "test". |
{{draft task}}Write a program that prompts the user to enter two different strings, and then output their longest common substring. Note that substrings are consecutive characters within a string. This distinguishes them from subsequences, which is any sequence of characters within a string, even if there are extraneous characters in between them. Hence, the longest common subsequence between "thisisatest" and "testing123testing" is "tsitest", whereas the longest common sub''string'' is just "test". |
||
References: |
|||
*[[http://en.wikipedia.org/wiki/Generalized_suffix_tree Generalize Suffix Tree]] |
|||
==C#== |
==C#== |
||