Efficient way to search a 2d matrix for another matrix of smaller size
I know KMP (Knuth–Morris–Pratt) is used for one dimensional search. Can it be applied on 2 dimensional array of data? Or is there a more开发者_如何学Python advanced one?
Maybe you can find something in this question. You should be able to use KMP with some adaption if you flatten the matrices you are looking for.
精彩评论