Answer the question
In order to leave comments, you need to log in
What is the most efficient way to check for occurrence of a sequence in an array?
Hello. I have a task - to find a sequence in an array. Let's say there is an array a={x,y,z,...} and an array b={x,y}. We need to check if array b is contained in a. What algorithm will be the most efficient here and what is its running time? The solution is desirable in C++\C#. Thanks in advance
Answer the question
In order to leave comments, you need to log in
If you need to check for a continuous sequence, then this is a search for a substring in the alphabet x, y, z, ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question