A Trie is a key-value store where the keys are of type String,
and the internal structure is a tree that branches on the bytes of the string.
- leaf {α : Type} : Option α → Trie α
- node1 {α : Type} : Option α → UInt8 → Trie α → Trie α
- node {α : Type} : Option α → ByteArray → Array (Trie α) → Trie α
Instances For
@[instance_reducible]
def Lean.Data.Trie.matchPrefix {α : Type} (s : String) (t : Trie α) (i : String.Pos.Raw) (endByte : Nat := s.utf8ByteSize) (endByte_valid : endByte ≤ s.utf8ByteSize := by simp) :
Option α
Find the longest key in the trie that is contained in the given string s at position i,
and return the associated value.