Class AVLTree<T>
An AVL tree implementation.
Assembly: Advanced.Algorithms.dll
Syntax
public class AVLTree<T> : IEnumerable<T>, IEnumerable where T : IComparable
Type Parameters
Constructors
AVLTree(Boolean)
Declaration
public AVLTree(bool enableNodeLookUp = false)
Parameters
Type |
Name |
Description |
Boolean |
enableNodeLookUp |
Enabling lookup will fasten deletion/insertion/exists operations
at the cost of additional space.
|
Properties
Count
Declaration
public int Count { get; }
Property Value
Methods
Contains(T)
Time complexity: O(log(n)).
Declaration
public bool Contains(T value)
Parameters
Type |
Name |
Description |
T |
value |
|
Returns
Delete(T)
Time complexity: O(log(n)).
Declaration
public void Delete(T value)
Parameters
Type |
Name |
Description |
T |
value |
|
FindMax()
Time complexity: O(log(n)).
Declaration
Returns
FindMin()
Time complexity: O(log(n)).
Declaration
Returns
GetEnumerator()
Declaration
public IEnumerator<T> GetEnumerator()
Returns
GetHeight()
Time complexity: O(log(n))
Declaration
Returns
HasItem(T)
Time complexity: O(log(n))
Declaration
public bool HasItem(T value)
Parameters
Type |
Name |
Description |
T |
value |
|
Returns
Insert(T)
Time complexity: O(log(n))
Declaration
public void Insert(T value)
Parameters
Type |
Name |
Description |
T |
value |
|
NextHigher(T)
Get the next higher value to given value in this BST.
Time complexity: O(log(n))
Declaration
public T NextHigher(T value)
Parameters
Type |
Name |
Description |
T |
value |
|
Returns
NextLower(T)
Get the next lower value to given value in this BST.
Time complexity: O(log(n))
Declaration
public T NextLower(T value)
Parameters
Type |
Name |
Description |
T |
value |
|
Returns
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Implements