open class Trie
(source)
Simple implementation of a Trie, used for indexing URLs.
Trie(character: Char, parent: Trie?)
Simple implementation of a Trie, used for indexing URLs. |
val children: SparseArray<Trie> |
open fun createNode(character: Char, parent: Trie): Trie
Creates a new node for the provided character and parent node. |
|
fun findNode(string: String): Trie? fun findNode(string: ReversibleString): Trie?
Finds the node corresponding to the provided string. |
|
fun put(string: String): Trie fun put(string: ReversibleString): Trie
Adds new nodes (recursively) for all chars in the provided string. fun put(character: Char): Trie
Adds a new node for the provided character if none exists. |
fun createRootNode(): Trie
Creates a new root node. |