# Inverse of Burrows-Wheeler Transform

What is the best solution for Inversion of Burrows-Wheeler Transform?

One with the least number of steps. (Best solution => One with a smaller average-case or worst-case time complexity)

Hopefully, a smaller time-complexity than this one.

• "This method" with or without the optimizations mentioned in the article? Did you use a trie? Sep 22, 2011 at 13:17
• Did you ask the question because of this competition? gild.com/challenges/details/244 Either way I doubt this is research level. Sep 22, 2011 at 16:11
• @vivek: I downvoted. Jouni Sirén's answer already pointed out that your question was not clear: the title is about the inverse transform, while the text seems to refer to the construction. Peter Shor's comment also pointed out that your question did not do a very good job at explaining exactly what you know already and what you have tried. Chao Xu hinted that your question might also be off-topic; it is currently formulated so that it does not sound like a research-level question (note that you did not specify exactly what you mean by "best": theory vs. practice, memory vs. time...). Sep 22, 2011 at 18:19
• @vivek: In brief, there are many opportunities for improving your question. Please edit it to remove any ambiguities, and to clarify exactly what you know already, what you want to know, and why. Show that you are serious and you have done your homework. Sep 22, 2011 at 18:21

Do you mean construction or inversion of BWT?

For construction, the best algorithm is probably the one by Okanohara and Sadakane. It takes $O(n)$ time and usually requires $2n$ to $2.5n$ bytes of memory for an input of length $n$. There is an implementation available at Google code.

I am not that familiar with BWT inversion algorithms. The papers of Kärkkäinen and Puglisi at ESA 2010 and CCP 2011 might provide a good starting point.

• Inverting the suffix array permutation is O(n) isn't it? Sep 26, 2011 at 18:18