MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / CreateTransition

Function CreateTransition

strings/ahocorasick/shared.go:116–118  ·  view source on GitHub ↗

CreateTransition Creates a transition for function σ(state,letter) = end.

(fromState int, overChar uint8, toState int, at map[int]map[uint8]int)

Source from the content-addressed store, hash-verified

114
115// CreateTransition Creates a transition for function σ(state,letter) = end.
116func CreateTransition(fromState int, overChar uint8, toState int, at map[int]map[uint8]int) {
117 at[fromState][overChar] = toState
118}
119
120// GetTransition Returns ending state for transition σ(fromState,overChar), '-1' if there is none.
121func GetTransition(fromState int, overChar uint8, at map[int]map[uint8]int) (toState int) {

Callers 2

BuildExtendedAcFunction · 0.85
ConstructTrieFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected