pub fn invert_bwt(bwt: &BWTSlice) -> Vec<u8> {
    let alphabet = Alphabet::new(bwt);
    let n = bwt.len();
    let bwtfind = bwtfind(bwt, &alphabet);
    let mut inverse = Vec::with_capacity(n);

    let mut r = bwtfind[0];
    for _ in 0..n {
        r = bwtfind[r];
        inverse.push(bwt[r]);
    }

    inverse
}
/// Calculate the inverse of a BWT of length n, which is the original text.
/// Complexity: O(n).
///
/// This only works if the last sentinel in the original text is unique
/// and lexicographically the smallest.
///
/// # Arguments
///
/// * `bwt` - the BWT
Calculate the inverse of a BWT of length n, which is the original text.

This only works if the last sentinel in the original text is unique
and lexicographically the smallest.
Calculate the inverse of a BWT of length n which is the original text . This only works if the last sentinel in the original text is unique and lexicographically the smallest .
pub fn invert_bwt(bwt: &BWTSlice) -> Vec<u8> {
    let alphabet = Alphabet::new(bwt);
    let n = bwt.len();
    let bwtfind = bwtfind(bwt, &alphabet);
    let mut inverse = Vec::with_capacity(n);
    let mut r = bwtfind[0];
    for _ in 0..n {
        r = bwtfind[r];
        inverse.push(bwt[r]);
    }
    inverse
}
pub fn invert_bwt ( bwt : & BWTSlice ) -> Vec < u8 > { let alphabet = Alphabet :: new ( bwt ) ; let n = bwt . len ( ) ; let bwtfind = bwtfind ( bwt , & alphabet ) ; let mut inverse = Vec :: with_capacity ( n ) ; let mut r = bwtfind [ 0 ] ; for _ in 0 .. n { r = bwtfind [ r ] ; inverse . push ( bwt [ r ] ) ; } inverse }
Calculate the inverse of a BWT of length n, which is the original text.
Calculate the inverse of a BWT of length n which is the original text .
bwt
&BWTSlice
bwt
&BWTSlice