Interface ISortedBinaryTree<T>
A self-sorting binary tree based on the heights of each node.
Inherited Members
Namespace: Towel.DataStructures
Assembly: Towel.dll
Syntax
public interface ISortedBinaryTree<T> : IDataStructure<T>, ISteppable<T>, System.Collections.Generic.IEnumerable<T>, DataStructure.IAddable<T>, DataStructure.IRemovable<T>, DataStructure.ICountable, DataStructure.IClearable, DataStructure.IAuditable<T>
Type Parameters
Name | Description |
---|---|
T | The type of values stored in this data structure. |
Properties
| Improve this Doc View SourceCurrentGreatest
Gets the current greated value in the tree.
Declaration
T CurrentGreatest { get; }
Property Value
Type | Description |
---|---|
T |
CurrentLeast
Gets the current least value in the tree.
Declaration
T CurrentLeast { get; }
Property Value
Type | Description |
---|---|
T |
Methods
| Improve this Doc View SourceContainsSift<TSift>(TSift)
Determines if the tree contains a value.
Declaration
bool ContainsSift<TSift>(TSift sift = default(TSift))
where TSift : struct, IFunc<T, CompareResult>
Parameters
Type | Name | Description |
---|---|---|
TSift | sift | The sifting function that respects the sorting of the tree. |
Returns
Type | Description |
---|---|
System.Boolean | True if the value is in the tree or false if not. |
Type Parameters
Name | Description |
---|---|
TSift | The type of the sifting function. |
StepperBreak<TStep>(T, T, TStep)
Does an optimized step function (left to right) for sorted binary search trees.
Declaration
StepStatus StepperBreak<TStep>(T minimum, T maximum, TStep step = default(TStep))
where TStep : struct, IFunc<T, StepStatus>
Parameters
Type | Name | Description |
---|---|---|
T | minimum | The minimum step value. |
T | maximum | The maximum step value. |
TStep | step | The step function. |
Returns
Type | Description |
---|---|
StepStatus | The result status of the stepper function. |
Type Parameters
Name | Description |
---|---|
TStep | The type of the step function. |
StepperReverseBreak<TStep>(TStep)
Does a step function (right to left) for sorted binary search trees.
Declaration
StepStatus StepperReverseBreak<TStep>(TStep step = default(TStep))
where TStep : struct, IFunc<T, StepStatus>
Parameters
Type | Name | Description |
---|---|---|
TStep | step | The step function. |
Returns
Type | Description |
---|---|
StepStatus | The result status of the stepper function. |
Type Parameters
Name | Description |
---|---|
TStep | The type of the step function. |
StepperReverseBreak<TStep>(T, T, TStep)
Does an optimized step function (right to left) for sorted binary search trees.
Declaration
StepStatus StepperReverseBreak<TStep>(T minimum, T maximum, TStep step = default(TStep))
where TStep : struct, IFunc<T, StepStatus>
Parameters
Type | Name | Description |
---|---|---|
T | minimum | The minimum step value. |
T | maximum | The maximum step value. |
TStep | step | The step function. |
Returns
Type | Description |
---|---|
StepStatus | The result status of the stepper function. |
Type Parameters
Name | Description |
---|---|
TStep | The type of the step function. |
TryGet<TSift>(TSift)
Tries to get a value.
Declaration
(bool Success, T Value, Exception? Exception) TryGet<TSift>(TSift sift = default(TSift))
where TSift : struct, IFunc<T, CompareResult>
Parameters
Type | Name | Description |
---|---|---|
TSift | sift | The sifting function that respects the sorting of the tree. |
Returns
Type | Description |
---|---|
System.ValueTuple<System.Boolean, T, System.Nullable<Exception>> | True if the value was found or false if not. |
Type Parameters
Name | Description |
---|---|
TSift | The type of the sifting function. |
TryRemoveSift<TSift>(TSift)
Tries to remove a value.
Declaration
(bool Success, Exception? Exception) TryRemoveSift<TSift>(TSift sift = default(TSift))
where TSift : struct, IFunc<T, CompareResult>
Parameters
Type | Name | Description |
---|---|---|
TSift | sift | The sifting function that respects the sorting of the tree. |
Returns
Type | Description |
---|---|
System.ValueTuple<System.Boolean, System.Nullable<Exception>> | True if the remove succeeded or false if not. |
Type Parameters
Name | Description |
---|---|
TSift | The type of the sifting function. |