|
halcheck 1.0
|
An implementation of a trie. Semantically, this corresponds to a function \(K^* \to V\). More...
#include <trie.hpp>
Classes | |
| class | iterator |
| Represents a pointer to a child trie. More... | |
Public Member Functions | |
| trie ()=default | |
| Constructs a trie where every node is assigned the same value. | |
| template<typename I > | |
| trie (V value, I first, I last) | |
| Constructs a trie with a given value and set of children. | |
| template<typename R > | |
| trie (V value, R &&range) | |
| Constructs a trie with a given value and set of children. | |
| const V & | operator* () const |
| Gets the value associated with the root node of this trie. | |
| template<typename R > | |
| const V & | operator[] (const R &range) const |
| Gets the value associated with a specific node. | |
| template<typename R > | |
| trie | drop (const R &range) const |
| Gets a specific subtree. | |
| template<typename I > | |
| trie | drop (I first, I last) const |
| Gets a specific subtree. | |
| trie | drop (const K &key) const |
| Gets a specific subtree. | |
| template<typename I > | |
| trie | set (I first, I last, V value) const |
| Constructs a new trie with a specific value replaced. | |
| template<typename R > | |
| trie | set (const R &range, V value) const |
| Constructs a new trie with a specific value replaced. | |
| iterator | begin () const |
| Returns an iterator to the first child. | |
| iterator | end () const |
| Returns an iterator to one past the last child. | |
| std::size_t | size () const |
| Returns the number of children in this trie. | |
| bool | empty () const |
| Determines whether this trie has any children. | |
| iterator | find (const K &key) const |
| Gets an iterator to the child indicated by the given key. | |
An implementation of a trie. Semantically, this corresponds to a function \(K^* \to V\).
| K | The type used to index child nodes. |
| V | The type of value stored in each node. |