I want use suffix arrays to find previous matches of text.
The simplest way is making suffixes, like
mississippi
ississippi
ssissippi
sissippi
issippi
ssippi
sippi
ippi
ppi
pi
i
and next sort by alphabetical order.
It has one disadvantage: we sort once, but if is updated each char, will slow (?)
I try next solution:
256 chars points to linked list (double linked when we want removed oldest elements), each coming char add element to top list of char.
It is good for most cases but I we have cycles like cycle one : aaaaa...aaaaaaaa or abababab.....abab
will be a lot elements for one letter and search will be slow.
How can be it solved?