Commit bc24566
authored
Add LCP check to fix toString in SuffixArray (#421)
When toString() was invoked just after creating the Suffix Array data structure, it gave null pointer exception when accessing actual array data member (sa) as the Suffix array and LCP array were not yet constructed.
Added a check to see if LCP was constructed before printing out the data members and construct them if needed.1 parent 1b17e3a commit bc24566
File tree
1 file changed
+1
-0
lines changed- src/main/java/com/williamfiset/algorithms/datastructures/suffixarray
1 file changed
+1
-0
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| |||
0 commit comments