Prefix Tree
class PrefixTree<K, V>(mapFactory: () -> MutableMap<K, PrefixTree<K, V>> = { mutableMapOf() })
Content copied to clipboard
A prefix tree, with amortized O(1) access time, amortized O(1) insertion time O(1), amortized O(1) removal time, and O(n) prune time. Thread-safe iff the internal transition tables, supplied by the factory, are thread-safe.
Author
Todd L Smith
Constructors
Link copied to clipboard
fun <K, V> PrefixTree(mapFactory: () -> MutableMap<K, PrefixTree<K, V>> = { mutableMapOf() })
Content copied to clipboard
Types
Functions
Extensions
Link copied to clipboard
Convenience getter for using string-keyed prefix trees.
Link copied to clipboard
Convenience accumulator for using string-keyed prefix trees.
Link copied to clipboard
inline operator fun <V> PrefixTree<Int, V>.set(key: String, value: V): V?
Content copied to clipboard
Convenience setter for using string-keyed prefix trees.