Class SizedAndThreadedAVLBalancedTreeMethods<TElement>

Namespace
Platform.Collections.Methods.Trees
Assembly
Platform.Collections.Methods.dll

Combination of Size, Height (AVL), and threads.

public abstract class SizedAndThreadedAVLBalancedTreeMethods<TElement> : SizedBinaryTreeMethodsBase<TElement> where TElement : IUnsignedNumber<TElement>, IComparisonOperators<TElement, TElement, bool>

Type Parameters

TElement
Inheritance
SizedAndThreadedAVLBalancedTreeMethods<TElement>
Inherited Members

Remarks

Based on: TreeLib.AVLTreeList. Which itself based on: GNOME/glib/gtree. The path buffer belongs to the instance, so one instance must not be used by several threads at once.

Methods

AttachCore(ref TElement, TElement)

Attaches the core using the specified root.

protected override void AttachCore(ref TElement root, TElement node)

Parameters

root TElement

The root.

node TElement

The node.

Exceptions

InvalidOperationException

Node with the same key already attached to a tree.

ClearNode(TElement)

Clears the node using the specified node.

protected override void ClearNode(TElement node)

Parameters

node TElement

The node.

Contains(TElement, TElement)

Determines whether this instance contains.

public override bool Contains(TElement node, TElement root)

Parameters

node TElement

The node.

root TElement

The root.

Returns

bool

The bool

DecrementBalance(TElement)

Decrements the balance using the specified node.

protected void DecrementBalance(TElement node)

Parameters

node TElement

The node.

DetachCore(ref TElement, TElement)

Detaches the core using the specified root.

protected override void DetachCore(ref TElement root, TElement node)

Parameters

root TElement

The root.

node TElement

The node.

Exceptions

InvalidOperationException

Cannot find a node.

InvalidOperationException

Cannot find a node.

GetBalance(TElement)

Gets the balance using the specified node.

protected abstract sbyte GetBalance(TElement node)

Parameters

node TElement

The node.

Returns

sbyte

The sbyte

GetLeftIsChild(TElement)

Determines whether this instance get left is child.

protected abstract bool GetLeftIsChild(TElement node)

Parameters

node TElement

The node.

Returns

bool

The bool

GetLeftOrDefault(TElement)

Gets the left or default using the specified node.

protected override TElement GetLeftOrDefault(TElement node)

Parameters

node TElement

The node.

Returns

TElement

The element

GetLeftest(TElement)

Gets the leftest using the specified current.

protected override TElement GetLeftest(TElement current)

Parameters

current TElement

The current.

Returns

TElement

The current.

GetNext(TElement)

Gets the next using the specified node.

protected override TElement GetNext(TElement node)

Parameters

node TElement

The node.

Returns

TElement

The current.

GetPrevious(TElement)

Gets the previous using the specified node.

protected override TElement GetPrevious(TElement node)

Parameters

node TElement

The node.

Returns

TElement

The current.

GetRightIsChild(TElement)

Determines whether this instance get right is child.

protected abstract bool GetRightIsChild(TElement node)

Parameters

node TElement

The node.

Returns

bool

The bool

GetRightOrDefault(TElement)

Gets the right or default using the specified node.

protected override TElement GetRightOrDefault(TElement node)

Parameters

node TElement

The node.

Returns

TElement

The element

GetRightest(TElement)

Gets the rightest using the specified current.

protected override TElement GetRightest(TElement current)

Parameters

current TElement

The current.

Returns

TElement

The current.

IncrementBalance(TElement)

Increments the balance using the specified node.

protected void IncrementBalance(TElement node)

Parameters

node TElement

The node.

LeftRotateWithBalance(TElement)

Lefts the rotate with balance using the specified node.

protected TElement LeftRotateWithBalance(TElement node)

Parameters

node TElement

The node.

Returns

TElement

The element

PrintNode(TElement, StringBuilder, int)

Prints the node using the specified node.

protected override void PrintNode(TElement node, StringBuilder sb, int level)

Parameters

node TElement

The node.

sb StringBuilder

The string builder.

level int

The level.

RightRotateWithBalance(TElement)

Rights the rotate with balance using the specified node.

protected TElement RightRotateWithBalance(TElement node)

Parameters

node TElement

The node.

Returns

TElement

The element

SetBalance(TElement, sbyte)

Sets the balance using the specified node.

protected abstract void SetBalance(TElement node, sbyte value)

Parameters

node TElement

The node.

value sbyte

The value.

SetLeftIsChild(TElement, bool)

Sets the left is child using the specified node.

protected abstract void SetLeftIsChild(TElement node, bool value)

Parameters

node TElement

The node.

value bool

The value.

SetRightIsChild(TElement, bool)

Sets the right is child using the specified node.

protected abstract void SetRightIsChild(TElement node, bool value)

Parameters

node TElement

The node.

value bool

The value.