BW Transform The Burrows-Wheeler transform of length- string is the word composed of the last letters of the sorted conjugates of . BW(x) n x x BW(x) x x[(n + i − 1) mod n] x[i..] x Today's topic Compute BW-string of in time in-place. x O(n ) 2 2 2
compute the position ( ) that will be inserted cyclic shift to the left by one z = z i+1 z = z i p # z z[i] z[p] i + r # z[i..i + r] The remain task is to find the rank of . x i 5 5
of the backward search on BW-string. be the number of characters smaller than in It is the starting position of suffixes starting with in the suffix array be the numberof characters in It is the position of of suffixes starting with in the suffix array Here, is the rank of of suffixes for . x[i..] x[i + 1..] q x[i] x[i + 1..n − 1] x[i] t x[i] x[i + 1..p − 1] x[i..] x[i] r = q + t x i x j j ≥ i 6 6
Crochemore, R. Grossi, J. Kärkkäinen and G. M. Landau. Computing the Burrows-Wheeler transform in place and in small space. J. Discrete Algorithms, 32:44–52, 2015. 9 9