in reply to Fast Way to find one array in second array

Please edit your node and put code tags around your arrays , besides @array=[] is broken syntax.

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.

edit

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

    right so if one string is: ABCDFG and the second is ABCDEFG then index will return -1 and I won't know that the first array represented by ABCDFG should be deleted. That would work if I were looking for paths that are segments of larger paths.

        thanks!