Implementation of string pattern matching using Suffix Array and LCP(-LR)

前端 未结 4 1008
太阳男子
太阳男子 2020-12-16 00:00

During the last weeks I tried to figure out how to efficiently find a string pattern within another string.

I found out that for a long time, the most efficient way

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-16 00:26

    Here is a nice post including some code to help you better understand LCP array and comparison implementation.

    I understand your desire is the code, rather than implementing your own. Although written in Java this is an implementation of Suffix Array with LCP by Sedgewick and Wayne from their Algorithms booksite. It should save you some time and should not be tremendously hard to port to C/C++.

    LCP array construction in pseudo for those who might want more information about the algorithm.

提交回复
热议问题