Conversation
cameroncuster
left a comment
There was a problem hiding this comment.
so if we are bringing in AC library, why not just use their mod-int?
| pub fn new(s: &[usize], max_val: usize) -> Self { | ||
| let sa = suffix_array_manual( |
There was a problem hiding this comment.
IK we previously discussed multiple constructors (one taking string as [T], and the other taking string as [usize] or [char] maybe); but I decided against it:
basically we need to store the string as a member var. So in order to have multiple constructors with different types, we need to templatize the string type; which made it less clean for similar reasons why templatized binary trie was less clean (you need a template type with a ton of traits)
So instead I opted for a single constructor, taking [usize]. If the input is a string, you can just map it to this type.
If the input is an array, you can call the compress function first
There was a problem hiding this comment.
yeah the compress as a separate helper makes a lot of sense, it really doesn't belong to the SA
might add more functions later; we'll see