Created
October 30, 2018 15:00
-
-
Save Kimundi/bcd11afc8ce6192fc6bc45abaf6f2d8c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
text: | |
sdsd | |
+--------+----+------+--------+ | |
| Suffix | SA | Rang | Unique | | |
+--------+----+------+--------+ | |
| d$ | 3 | 0 | True | | |
| ds | 1 | 1 | True | | |
| sd | 0 | 3 | False | | |
| sd | 2 | 3 | False | | |
+--------+----+------+--------+ | |
+SA-2--+ | |
| i | | |
+------+ | |
| 3 | | |
| 1 | | |
| 0 | | |
| 2 | | |
+------+ | |
+ISA-2--+ | |
| i | | |
+-------+ | |
| 3 | | |
| 1 | | |
| 3 | | |
| 0 | | |
+-------+ | |
+Final SA----+ | |
| i | | |
+------------+ | |
| 3 | | |
| 1 | | |
| None | | |
| None | | |
+------------+ | |
############################################### | |
while size > 0, size = 4: | |
For j=1, discard (SA[j] - h, ISA[SA[j] - h], ISA[SA[j]]) because SA[j] - h is negative | |
For j=2, discard (SA[j] - h, ISA[SA[j] - h], ISA[SA[j]]) because SA[j] - h is negative | |
+Tuples-----+----------------+------------+ | |
| SA[j] - h | ISA[SA[j] - h] | ISA[SA[j]] | | |
+-----------+----------------+------------+ | |
| 1 | 1 | 0 | | |
| 0 | 3 | 3 | | |
+-----------+----------------+------------+ | |
+Tuples (sorted by second component)------+ | |
| SA[j] - h | ISA[SA[j] - h] | ISA[SA[j]] | | |
+-----------+----------------+------------+ | |
| 1 | 1 | 0 | | |
| 0 | 3 | 3 | | |
+-----------+----------------+------------+ | |
+blue--+ | |
| i | | |
+------+ | |
| 1 | | |
| 3 | | |
+------+ | |
+ISA-4--+ | |
| i | | |
+-------+ | |
| 3 | | |
| 1 | | |
| 3 | | |
| 0 | | |
+-------+ | |
+SA-4--+ | |
| i | | |
+------+ | |
| 1 | | |
| 0 | | |
+------+ | |
############################################### | |
while size > 0, size = 2: | |
For j=0, discard (SA[j] - h, ISA[SA[j] - h], ISA[SA[j]]) because SA[j] - h is negative | |
For j=1, discard (SA[j] - h, ISA[SA[j] - h], ISA[SA[j]]) because SA[j] - h is negative | |
+Tuples-----+----------------+------------+ | |
| SA[j] - h | ISA[SA[j] - h] | ISA[SA[j]] | | |
+-----------+----------------+------------+ | |
+Tuples (sorted by second component)------+ | |
| SA[j] - h | ISA[SA[j] - h] | ISA[SA[j]] | | |
+-----------+----------------+------------+ | |
+blue--+ | |
| i | | |
+------+ | |
+ISA-8--+ | |
| i | | |
+-------+ | |
| 3 | | |
| 1 | | |
| 3 | | |
| 0 | | |
+-------+ | |
+SA-8--+ | |
| i | | |
+------+ | |
############################################### | |
+Final SA---+ | |
| i | | |
+-----------+ | |
| 3 | | |
| 1 | | |
| None | | |
| 0 | | |
+-----------+ | |
[3, 1, None, 0] | |
BUG! A entry in the Final SA is still None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment