Bug 12: Bungled Burrows-Wheeler Transform
- The BWT reorders a sequence of bytes to simplify compression. The inverse transform is efficient.
- This code sorts a slice of integers. Each integer is an offset into the (length n) input slice a.
- These n integers are sorted lexicographically according to the byte sequences they represent.
- Integer i represents the (length n) byte sequence a[i], a[i+1], ..., a[n-1], a, ..., a[i-2], a[i-1].
- For each integer i in this sorted order, the code outputs byte a[i-1].
- The effect is that the input bytes are reordered according to the contexts in which they occur.
Fix The Tiny Bug In This Go Code: