Class BTreeLinked<T, TCompare>
B-Tree Data structure.
Inheritance
System.Object
BTreeLinked<T, TCompare>
Implements
ISteppable<T>
System.Collections.Generic.IEnumerable<T>
DataStructure.IComparing<T, TCompare>
ICloneable<BTreeLinked<T, TCompare>>
Namespace: Towel.DataStructures
Assembly: Towel.dll
Syntax
public class BTreeLinked<T, TCompare> : object, IDataStructure<T>, ISteppable<T>, System.Collections.Generic.IEnumerable<T>, DataStructure.IAddable<T>, DataStructure.IRemovable<T>, DataStructure.ICountable, DataStructure.IClearable, DataStructure.IAuditable<T>, DataStructure.IComparing<T, TCompare>, ICloneable<BTreeLinked<T, TCompare>> where TCompare : struct, IFunc<T, T, CompareResult>
Type Parameters
Name | Description |
---|---|
T | The type to store |
TCompare | The type that is comparing |
Constructors
| Improve this Doc View SourceBTreeLinked(Byte, TCompare)
Creates a B-Tree having nodes of given maximum size. Maximum size must be even
Declaration
public BTreeLinked(byte maxdegree, TCompare compare = default(TCompare))
Parameters
Type | Name | Description |
---|---|---|
System.Byte | maxdegree | The maximum degree/children a node can have. Must be even |
TCompare | compare | The function for comparing |
Properties
| Improve this Doc View SourceCompare
Gets the value of the comparer that is comparing T
values.
Declaration
public TCompare Compare { get; }
Property Value
Type | Description |
---|---|
TCompare |
Count
Gets the current count of the data structure.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
MaxDegree
The fixed size of a node within this tree
Declaration
public byte MaxDegree { get; }
Property Value
Type | Description |
---|---|
System.Byte |
Methods
| Improve this Doc View SourceClear()
Returns the data structure to an empty state.
Declaration
public void Clear()
Contains(T)
Checks if the data structure contains a value.
Declaration
public bool Contains(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value to look for in the data structure. |
Returns
Type | Description |
---|---|
System.Boolean | True if the value exists in the data structure. False if not. |
Implements
System.Collections.Generic.IEnumerable<>