Answer the question
In order to leave comments, you need to log in
Algorithm for finding identical sections in N lines?
I warn you right away, I don’t need to solve this for study or anything accountable, I just woke up a wild interest.
Let's say there are several lines (5, 10, 15 ..) of absolutely arbitrary type and arbitrary length, for simplicity, let's take this:
ABCBDCEACA,
BCDCEEAEDAD,
CAEDCECDAE ... etc.
How can you find a sequence of characters (the longest possible, of course) that is in all strings, if it is not known in advance?
The substring in the example turns out to be DCE, but how can I determine it using the program, I haven’t found any similar algorithms yet ... or I didn’t search well?
Answer the question
In order to leave comments, you need to log in
heheh, I don’t know why they don’t like to use the Aho-Karasik algorithm, in my opinion the most convenient for such purposes
will be very easy to find the longest branch in the tree.
Such algorithms are extremely widely used in bioinformatics. Here is the direction to start looking en.wikipedia.org/wiki/BLAST
Take a look at the "How it works" section
of this article .
It describes the direction in which I would move to write such an algorithm.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question