Skip to content

Commit

Permalink
Updated SA (bug fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
zscoder authored Oct 6, 2016
1 parent f39b462 commit 675e404
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Data Structures Class Template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ int cmp(suffix a, suffix b)
return (a.rank[0] == b.rank[0])? (a.rank[1] < b.rank[1] ?1: 0):(a.rank[0] < b.rank[0] ?1: 0);
}

struct SuffixLCPArray //mostly/all from geeksforgeeks
struct SuffixLCPArray //mostly/all from geeksforgeeks, to work for general alphabet remove the - 'a'
{
vector<suffix> suffixes;
vi suffixArr;
Expand All @@ -888,7 +888,7 @@ struct SuffixLCPArray //mostly/all from geeksforgeeks
int n = txt.length();
// A structure to store suffixes and their indexes

suffixes.resize(n+1);
suffixes.resize(n);
// Store suffixes and their indexes in an array of structures.
// The structure is needed to sort the suffixes alphabatically
// and maintain their old indexes while sorting
Expand Down

0 comments on commit 675e404

Please sign in to comment.