[−][src]Struct contest_algorithms::string_proc::SuffixArray
Suffix array data structure, useful for a variety of string queries.
Fields
sfx: Vec<usize>
The suffix array itself, holding suffix indices in sorted order.
rank: Vec<Vec<usize>>
rank[i][j] = rank of the j'th suffix, considering only 2^i chars. In other words, rank[i] is a ranking of the substrings text[j..j+2^i].
Methods
impl SuffixArray
[src]
pub fn new(text: &[u8]) -> Self
[src]
Suffix array construction in O(n log n) time.
pub fn longest_common_prefix(&self, i: usize, j: usize) -> usize
[src]
Computes the length of longest common prefix of text[i..] and text[j..].
Auto Trait Implementations
impl Sync for SuffixArray
impl Send for SuffixArray
impl Unpin for SuffixArray
impl RefUnwindSafe for SuffixArray
impl UnwindSafe for SuffixArray
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,