Chapter 10 · SimulationString Transformation: Burrows–Wheeler Transform? ← Chapter 10 Input Add $ Load Input Step Auto Play Reset1. Generate Rotations2. Sort Rotations3. Read Last ColumnRotation TableBWT Result–Not built yet.StepReady.CloseBurrows–Wheeler TransformAll circular rotations are generated, sorted lexicographically, and the last column is read off to obtain the BWT.How to useType a string of up to 12 characters and press Load Input (use Reset to start over with the same input).Add $ appends the $ end marker, which sorts before every letter and digit. The transform is also computed without the marker, but the original string can then be recovered only if the row index is stored as well.Step performs one step: first one rotation per step, then sorting, then reading the last column. Auto Play plays the remaining steps (press again to pause).In the table, the first column (F) is shown in the link color and the last column (L) in red; the newest rotation is highlighted. After sorting, the framed row is the original string; Shift is the rotation amount (with $, this column is the suffix array).Why is it useful?Sorting the rotations gathers the characters that precede similar contexts, so the last column contains long runs of equal characters (for example BANANA$ → ANNB$AA). Run-length encoding (RLE) and move-to-front coding compress this well; this is the core of bzip2.Inverting the transformThe first column F is the sorted version of the last column L. The LF mapping links the i-th occurrence of a character in L to its i-th occurrence in F; the original string is then rebuilt backwards, starting from the row that holds it.ComplexityThis brute-force method builds and sorts n rotations of length n: O(n² log n) time and O(n²) memory. Practical implementations derive the BWT from a suffix array in O(n) or O(n log n) time.