suffix-array

strcmp for python or how to sort substrings efficiently (without copy) when building a suffix array

Here's a very simple way to build an suffix array from a string in python: def sort_offsets(a, b): return cmp(content[a:], content[b:]) content = "foobar baz foo" suffix_array.sort(cmp=sort_offsets) print suffix_array [6, 10, 4, 8, 3, 7, 11, 0, 13, 2, 12, 1, 5, 9] However, "content[a:]" makes a copy of content, which becomes very...

Efficient suffix array algorithm in c#

Does anyone have any suggestions about where I can find a C# implementation for suffix arrays? I'd prefer not to reinvent the wheel... ...

Suffix Array Implementation in Java

I'm looking to write an efficient n-order Markov chain method to generate random text strings given a set of example text. I currently have a Java implementation that uses several layers of Maps, but it's clunky. A suffix array would be perfect for my needs, but I'm not clear if that can be efficiently implemented in Java. In C I mig...