[][src]Struct contest_algorithms::string_proc::SuffixArray

pub struct SuffixArray {
    pub sfx: Vec<usize>,
    pub rank: Vec<Vec<usize>>,
}

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

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]