Skip to content

Commit da025de

Browse files
authored
Updated c++ code to work on current style of suffix automaton
This is tested on current suffix automaton. Also, made more modular
1 parent 9075aed commit da025de

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/string/suffix-automaton.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,9 +501,12 @@ Therefore, given $minlen(v) = 1 + len(link(v))$, we have total distinct substrin
501501
This is demonstrated succinctly below:
502502
503503
```cpp
504-
long long tot{};
505-
for(int i=1;i<sz;i++) {
506-
tot+=len[i] - len[link[i]];
504+
long long get_diff_strings(){
505+
ll tot{};
506+
for(int i=1;i<sz;i++) {
507+
tot+=st[i].len-st[st[i].link].len;
508+
}
509+
return tot;
507510
}
508511
```
509512

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy