suffixArray

return SA!T. each character must be inside [T(0), T(B)).

SA!T
suffixArray
(
T
)
(
in T[] _s
,
int B = 200
)

Examples

1 import std.algorithm : equal, map;
2 string s = "abracadabra";
3 auto saInfo = s.suffixArray;
4 assert(equal(saInfo.sa.map!(i => s[i..$]), [
5     "",
6     "a",
7     "abra",
8     "abracadabra",
9     "acadabra",
10     "adabra",
11     "bra",
12     "bracadabra",
13     "cadabra",
14     "dabra",
15     "ra",
16     "racadabra",
17 ]));

Meta