Prostu dość zawsze albo się strugach wypatrzą też grier tylko For example: SA: A= B= N= Scan 6. Input 'A' is type L, we put 5 bucket A. SA: A= B= N= Scan 5. Input 'N' is type L, we put 4 at the left of bucket N. SA: A= B= N= Scan 3. Input 'N' is type L, we put 2 at the next open spot bucket N. SA: A= B= N= Scan 1. Input 'B' is type L, we put 0 at the first open spot bucket B. SA: A= B= N= Scan 0. There is no character to the left, continue. Scan 4. Input is type S continue. Scan 2. Input is type S continue. We now have the complete suffix array, Besides the input array and SA, the only additional memory needed is array of 256 pointers to the first available position each bucket. DivSufSort. DivSufSort improves on Ikoh-Tanaka by directly sorting only the last S type suffix each run of consecutive type S. Then it induces the rest of the S's a right to left scan, filling each bucket from the right side. For each element SA, if input is type S, then its index is put at the rightmost open position the appropriate bucket This process is just like the induced sort of Itoh-Kanaka, but the opposite direction. After this step, the type L suffixes are sorted as Itoh-Kanaka. This 3 step method was first described by DivSufSort would still have O complexity due to the string sorting the first step. To avoid this problem, it detects and induces tandem repeats like with MSufSort v2. MSufSort v3. MSufSort version 3 uses a completely different suffix array sorting algorithm than version 2 It uses slightly more than 5n memory. It is used the M03 compressor. MSufSort v3 builds the SA rather than the It first uses a counting sort on the first two bytes to sort into 64K buckets. Then each bucket is sorted using the DivSufSort algorithm with detection and induction of tandem repeats as MSufSort v2 to avoid delays caused by common prefixes. Typically about 30% of the suffixes need to be sorted and the rest are induced. Strings are sorted using multikey quicksort As optimization, groups smaller than 64 elements are sorted using insertion sort. Also, to control the size of the recursion stack, the sorting algorithm is changed to a heapsort after a recursion depth of 48. Bijective BWT. A Burrows-Wheeler transform of a string consists of the characters of that string sorted by context, plus the index of the new position of the original start of the string. This index is needed because the context sorted string is not unique. For example, the BWT of BANANA is and the BWT of its rotation ANANAB is Thus, the BWT is not a bijection. Note also that adding the sentinel does not make BWT a bijection either. Although the sentinel makes the context sort unique, it increases the size of the output string. A. discovered 2007 a bijective variant of the BWT which omits the need to transmit the index of the starting string. Because the output of the BWTS is the same size as the input, all strings also have a valid inverse BWTS. The algorithm is described who also extended the idea to the sort transform. The idea is to divide the input string into a set of smaller strings such that the starting index of each substring is at a known, fixed location, such as at the first character. Specifically, the input is partitioned into a lexicographically nonincreasing sequence of words. A word is a string that lexicographically precedes any of its rotations. For example, the factorization of BANANA is A factorization is unique and can be calculated O time. Recall that the inverse BWT is to use a counting sort to calculate T=sort and then to build and traverse a linked list from the i'th occurrence of c T to the i'th occurrence of c BWT. a BWT, this linked list usually forms a single loop that returns to the initially transmitted index when complete. the BWTS, the list forms one loop for each word. The end of each word is detected by traversing the list back to its start. The next loop starts at the first unused element. The words are restored right to left. For example, we compute the BWTS of BANANA by sorting