Jump to content

Longest common substring: Difference between revisions

no edit summary
(Explaining the difference between a substring and a subsequence.)
No edit summary
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".
 
References:
*[[http://en.wikipedia.org/wiki/Generalized_suffix_tree Generalize Suffix Tree]]
==C#==
 
2,172

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.