(L)
| 243 | l[:] = l[c:c+1] + l[0:c] + l[c+1:] |
| 244 | |
| 245 | def bwt_transform(L): |
| 246 | # Semi-inefficient way to get the character counts |
| 247 | F = ''.join(sorted(L)) |
| 248 | base = [] |
| 249 | for i in range(256): |
| 250 | base.append(F.find(chr(i))) |
| 251 | |
| 252 | pointers = [-1] * len(L) |
| 253 | for i, char in enumerate(L): |
| 254 | symbol = ord(char) |
| 255 | pointers[base[symbol]] = i |
| 256 | base[symbol] += 1 |
| 257 | return pointers |
| 258 | |
| 259 | def bwt_reverse(L, end): |
| 260 | out = [] |