Class TreeDictionary<TK, TV>
A Dictionary implementation using balanced binary search tree (log(n) operations in worst case)
This may be better than regular Dictionary implementation which can give o(K) in worst case (but O(1) when collisions K is avoided )
Inheritance
TreeDictionary<TK, TV>
Assembly: Advanced.Algorithms.dll
Syntax
public class TreeDictionary<TK, TV>
where TK : IComparable
Type Parameters
Constructors
TreeDictionary()
Declaration
Properties
Count
Declaration
public int Count { get; }
Property Value
Methods
Add(TK, TV)
Declaration
public void Add(TK key, TV value)
Parameters
Type |
Name |
Description |
TK |
key |
|
TV |
value |
|
ContainsKey(TK)
Declaration
public bool ContainsKey(TK key)
Parameters
Type |
Name |
Description |
TK |
key |
|
Returns
GetValue(TK)
Declaration
public TV GetValue(TK key)
Parameters
Type |
Name |
Description |
TK |
key |
|
Returns
Remove(TK)
Declaration
public void Remove(TK key)
Parameters
Type |
Name |
Description |
TK |
key |
|