Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Javadoc for topoSortStates method #12292

Merged
merged 1 commit into from
May 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,14 @@ static Automaton totalize(Automaton a) {
* non-recursive, so it will not exhaust the java stack for automaton matching long strings. If
* there are dead states in the automaton, they will be removed from the returned array.
*
* <p>Note: This method uses a deque to iterative the states, which could potentially consume a
* lot of heap space for some automatons. Specifically, automatons with a deep level of states
* (i.e., a large number of transitions from the initial state to the final state) may
* particularly contribute to high memory usage. The memory consumption of this method can be
* considered as O(N), where N is the depth of the automaton (the maximum number of transitions
* from the initial state to any state). However, as this method detects cycles, it will never
* attempt to use infinite RAM.
*
* @param a the Automaton to be sorted
* @return the topologically sorted array of state ids
*/
Expand Down