Show / Hide Table of Contents

Interface ISortedBinaryTree<T>

A self-sorting binary tree based on the heights of each node.

Inherited Members
IDataStructure<T>.ToArray()
ISteppable<T>.StepperBreak<TStep>(TStep)
DataStructure.IAddable<T>.TryAdd(T)
DataStructure.IRemovable<T>.TryRemove(T)
DataStructure.ICountable.Count
DataStructure.IClearable.Clear()
DataStructure.IAuditable<T>.Contains(T)
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 Source

CurrentGreatest

Gets the current greated value in the tree.

Declaration
T CurrentGreatest { get; }
Property Value
Type Description
T
| Improve this Doc View Source

CurrentLeast

Gets the current least value in the tree.

Declaration
T CurrentLeast { get; }
Property Value
Type Description
T

Methods

| Improve this Doc View Source

ContainsSift<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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

Extension Methods

Steppable.Stepper<T>(ISteppable<T>, Action<T>)
Steppable.Stepper<T, TStep>(ISteppable<T>, TStep)
Steppable.StepperBreak<T>(ISteppable<T>, Func<T, StepStatus>)
DataStructure.Add<T>(DataStructure.IAddable<T>, T)
DataStructure.Remove<T>(DataStructure.IRemovable<T>, T)
SortedBinaryTree.ContainsSift<T>(ISortedBinaryTree<T>, Func<T, CompareResult>)
SortedBinaryTree.TryGet<T>(ISortedBinaryTree<T>, Func<T, CompareResult>)
SortedBinaryTree.TryRemoveSift<T>(ISortedBinaryTree<T>, Func<T, CompareResult>)
SortedBinaryTree.Stepper<T>(ISortedBinaryTree<T>, T, T, Action<T>)
SortedBinaryTree.Stepper<T, TStep>(ISortedBinaryTree<T>, T, T, TStep)
SortedBinaryTree.StepperBreak<T>(ISortedBinaryTree<T>, T, T, Func<T, StepStatus>)
SortedBinaryTree.StepperReverse<T>(ISortedBinaryTree<T>, T, T, Action<T>)
SortedBinaryTree.StepperReverse<T, TStep>(ISortedBinaryTree<T>, T, T, TStep)
SortedBinaryTree.StepperReverseBreak<T>(ISortedBinaryTree<T>, T, T, Func<T, StepStatus>)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX