Skip to content

Commit

Permalink
feat: suffix automaton
Browse files Browse the repository at this point in the history
  • Loading branch information
ttamx committed Aug 16, 2024
1 parent 3804935 commit 10fa66e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions content/strings/SuffixAutomaton.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
/**
* Author: Teetat T.
* Date: 2024-06-14
* Description: Suffix Automaton.
* Find whether a string $t$ is a substring of a string $s$ by traversing the automaton.
* Find whether a string $t$ is a suffix of a string $s$ by checking whether the last node is a terminal node.
* Find the number of distinct substrings of a string $s$ by calculating the number of distinc path using DP.
* Count the number of occurrences of string $t$ in string $s$. Let $p$ be the node we end up at after traversing $t$ in the automaton. The answer is the number of paths from $p$ to terminal nodes.
* Find first occurrence of string $t$ in string $s$ by calculating the longest path in the automaton after reaching node $p$.
* Description: Suffix Automaton.\\
* Find whether a string $t$ is a substring of a string $s$ by traversing the automaton.\\
* Find whether a string $t$ is a suffix of a string $s$ by checking whether the last node is a terminal node.\\
* Find the number of distinct substrings of a string $s$ by calculating the number of distinc path using DP.\\
* Count the number of occurrences of string $t$ in string $s$. Let $p$ be the node we end up at after traversing $t$ in the automaton. The answer is the number of paths from $p$ to terminal nodes.\\
* Find first occurrence of string $t$ in string $s$ by calculating the longest path in the automaton after reaching node $p$.\\
*/

template<class STR>
Expand Down

0 comments on commit 10fa66e

Please sign in to comment.