in reply to Fast Way to find one array in second array
Concerning your question, the fastest way would be to mimic the algorithm index is using in its implementation. (Forgot the name...)°
For this you need to prepare jump tables for each array.
A pragmatic approach would be to generate a string for each array, something like concatenation of the first character.
If the first-character string isn't found with index you can proceed, otherwise index gives you a hint where to compare both arrays!
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
°) here it is Boyer-Moore_string_search_algorithm
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Fast Way to find one array in second array
by melmoth (Acolyte) on Aug 14, 2016 at 18:45 UTC | |
by LanX (Saint) on Aug 14, 2016 at 18:52 UTC | |
by melmoth (Acolyte) on Aug 14, 2016 at 19:20 UTC |