Class TrieLinkedHashLinked<T, TEquate, THash>
A trie data structure that allows partial value sharing to reduce redundant memory.
Inheritance
System.Object
TrieLinkedHashLinked<T, TEquate, THash>
Implements
ITrie<T>
System.Collections.Generic.IEnumerable<Action<Action<T>>>
ICloneable<TrieLinkedHashLinked<T, TEquate, THash>>
DataStructure.IEquating<T, TEquate>
DataStructure.IHashing<T, THash>
Namespace: Towel.DataStructures
Assembly: Towel.dll
Syntax
public class TrieLinkedHashLinked<T, TEquate, THash> : object, ITrie<T>, IDataStructure<Action<Action<T>>>, ISteppable<Action<Action<T>>>, System.Collections.Generic.IEnumerable<Action<Action<T>>>, DataStructure.ICountable, DataStructure.IClearable, DataStructure.IAddable<Action<Action<T>>>, DataStructure.IRemovable<Action<Action<T>>>, DataStructure.IAuditable<Action<Action<T>>>, ICloneable<TrieLinkedHashLinked<T, TEquate, THash>>, DataStructure.IEquating<T, TEquate>, DataStructure.IHashing<T, THash> where TEquate : struct, IFunc<T, T, bool> where THash : struct, IFunc<T, int>
Type Parameters
Name | Description |
---|---|
T | The type of values in the trie. |
TEquate | The type of function for quality checking |
THash | The type of function for hashing |
Constructors
| Improve this Doc View SourceTrieLinkedHashLinked(TEquate, THash)
Constructs a new trie that uses linked hash tables of linked lists.
Declaration
public TrieLinkedHashLinked(TEquate equate = default(TEquate), THash hash = default(THash))
Parameters
Type | Name | Description |
---|---|---|
TEquate | equate | The equality delegate for the keys. |
THash | hash | The hashing function for the keys. |
TrieLinkedHashLinked(TrieLinkedHashLinked<T, TEquate, THash>)
This constructor is for cloning purposes.
Declaration
public TrieLinkedHashLinked(TrieLinkedHashLinked<T, TEquate, THash> trie)
Parameters
Type | Name | Description |
---|---|---|
TrieLinkedHashLinked<T, TEquate, THash> | trie | The trie to clone. |
Properties
| Improve this Doc View SourceCount
The current count of the trie.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Equate
The equality function of the keys.
Declaration
public TEquate Equate { get; }
Property Value
Type | Description |
---|---|
TEquate |
Hash
The hash fucntion for the keys.
Declaration
public THash Hash { get; }
Property Value
Type | Description |
---|---|
THash |
Methods
| Improve this Doc View SourceTryAdd(Action<Action<T>>)
Tries to add a value to a data structure.
Declaration
public (bool Success, Exception? Exception) TryAdd(Action<Action<T>> stepper)
Parameters
Type | Name | Description |
---|---|---|
Action<Action<T>> | stepper |
Returns
Type | Description |
---|---|
System.ValueTuple<System.Boolean, System.Nullable<Exception>> | True if the value was added or false if not. |
Implements
System.Collections.Generic.IEnumerable<>