author    = {Michael H. Albert and
               Marie{-}Louise Lackner and
               Martin Lackner and
               Vincent Vatter},
  title       = {The Complexity of Pattern Matching for 321-Avoiding and Skew-Merged Permutations},
  url = {http://dmtcs.episciences.org/2607},
  journal = {{Discrete Mathematics & Theoretical Computer Science}},
  volume = {{vol. 18 no. 2, Permutation Patterns 2015}},
  year = {2016},
The first algorithm is applicable if both $\pi$ and $\tau$ are $321$-avoiding; the second is applicable if $\pi$ and $\tau$ are skew-merged.
Both algorithms have a runtime of $O(kn)$, where $k$ is the length of $\pi$ and $n$ the length of $\tau$.},