diff options
| author | akiyamn | 2021-04-22 11:23:47 +1000 |
|---|---|---|
| committer | akiyamn | 2021-04-22 11:23:47 +1000 |
| commit | eff620948c6140fea0d15f7e63055550a278a9bf (patch) | |
| tree | 9f7d6665136d6a998fbd2b5f55866ba6be590277 /ass2/q2/suffix_array.py | |
| parent | 6a7732a192f9f6c3ebc16f86875e9fb627ce7af4 (diff) | |
| download | fit3155-eff620948c6140fea0d15f7e63055550a278a9bf.tar.gz fit3155-eff620948c6140fea0d15f7e63055550a278a9bf.zip | |
Ass 2 - Ukkonen 2: Electric Boogaloo
Diffstat (limited to 'ass2/q2/suffix_array.py')
| -rw-r--r-- | ass2/q2/suffix_array.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ass2/q2/suffix_array.py b/ass2/q2/suffix_array.py index db22c3e..eccc99e 100644 --- a/ass2/q2/suffix_array.py +++ b/ass2/q2/suffix_array.py @@ -159,6 +159,7 @@ def suffix_tree(string): Node.global_end += 1 # Rule 1s implicitly for j in range(last_j + 1, i + 1): print(string[0:i + 1], end=": ") + print(active_node, active_edge, active_length) # if 2 or more letter string, just match the last character at the current position (we already went # there) i.e. i i think char = string[i] if i - j <= 1 else string[i] @@ -196,4 +197,4 @@ def suffix_tree(string): print("\n" * 10) -suffix_tree("abacabad$") +suffix_tree("abcabxabcd") |
