Skip to Main Content
As an important variant of the Burrows-Wheeler Transform (BWT), the Sort Transform (ST) can speed up the transformation by sorting only a portion of the matrix. However, because the currently known inverse ST algorithms need to retrieve the complete k-order contexts and use hash tables, they are less efficient than the inverse BWT. In this paper, we propose three fast and memory-efficient inverse ST algorithms. The first algorithm uses two auxiliary vectors to replace the hash tables. The algorithm achieves O(kN) time and space complexities for a text of N characters under the context order k. The second uses two additional compact "alternate vectors" to further eliminate the need to restore all of the k-order contexts and achieve O(N) space complexity. Moreover, the third uses a "doubling technique" to further reduce the time complexity to O(N log2 k). The hallmark of these three algorithms is that they can invert the ST in a manner similar to inverting BWT in that they all make use of precalculated auxiliary mapping vectors and require no hash tables. These unifying algorithms can also better explain the connection between the BWT and the ST: Not only can their forward components be performed by the same algorithm framework, but their respective inverse components can also be efficiently conducted by the unifying algorithm framework proposed in the present work.