Search Results for

    Show / Hide Table of Contents

    Class SplayTree<T>

    A splay tree implementation.

    Inheritance
    Object
    SplayTree<T>
    Implements
    IEnumerable<T>
    IEnumerable
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Advanced.Algorithms.DataStructures
    Assembly: Advanced.Algorithms.dll
    Syntax
    public class SplayTree<T> : IEnumerable<T>, IEnumerable where T : IComparable
    Type Parameters
    Name Description
    T

    Constructors

    | Improve this Doc View Source

    SplayTree()

    Declaration
    public SplayTree()
    | Improve this Doc View Source

    SplayTree(IEnumerable<T>)

    Initialize the BST with given sorted keys. Time complexity: O(n).

    Declaration
    public SplayTree(IEnumerable<T> sortedCollection)
    Parameters
    Type Name Description
    IEnumerable<T> sortedCollection

    The sorted collection.

    Properties

    | Improve this Doc View Source

    Count

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    Int32

    Methods

    | Improve this Doc View Source

    AsEnumerableDesc()

    Descending enumerable.

    Declaration
    public IEnumerable<T> AsEnumerableDesc()
    Returns
    Type Description
    IEnumerable<T>
    | Improve this Doc View Source

    Delete(T)

    Time complexity: O(n)

    Declaration
    public void Delete(T value)
    Parameters
    Type Name Description
    T value
    | Improve this Doc View Source

    ElementAt(Int32)

    Time complexity: O(log(n))

    Declaration
    public T ElementAt(int index)
    Parameters
    Type Name Description
    Int32 index
    Returns
    Type Description
    T
    | Improve this Doc View Source

    FindMax()

    Time complexity: O(n)

    Declaration
    public T FindMax()
    Returns
    Type Description
    T
    | Improve this Doc View Source

    FindMin()

    Time complexity: O(n)

    Declaration
    public T FindMin()
    Returns
    Type Description
    T
    | Improve this Doc View Source

    GetEnumerator()

    Declaration
    public IEnumerator<T> GetEnumerator()
    Returns
    Type Description
    IEnumerator<T>
    | Improve this Doc View Source

    GetEnumeratorDesc()

    Declaration
    public IEnumerator<T> GetEnumeratorDesc()
    Returns
    Type Description
    IEnumerator<T>
    | Improve this Doc View Source

    HasItem(T)

    Time complexity: O(n)

    Declaration
    public bool HasItem(T value)
    Parameters
    Type Name Description
    T value
    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    IndexOf(T)

    Time complexity: O(log(n))

    Declaration
    public int IndexOf(T item)
    Parameters
    Type Name Description
    T item
    Returns
    Type Description
    Int32
    | Improve this Doc View Source

    Insert(T)

    Time complexity: O(n)

    Declaration
    public void Insert(T value)
    Parameters
    Type Name Description
    T value
    | Improve this Doc View Source

    NextHigher(T)

    Get the next higher value to given value in this BST. Time complexity: O(n).

    Declaration
    public T NextHigher(T value)
    Parameters
    Type Name Description
    T value
    Returns
    Type Description
    T
    | Improve this Doc View Source

    NextLower(T)

    Get the next lower value to given value in this BST. Time complexity: O(n).

    Declaration
    public T NextLower(T value)
    Parameters
    Type Name Description
    T value
    Returns
    Type Description
    T
    | Improve this Doc View Source

    RemoveAt(Int32)

    Time complexity: O(log(n))

    Declaration
    public T RemoveAt(int index)
    Parameters
    Type Name Description
    Int32 index
    Returns
    Type Description
    T

    Explicit Interface Implementations

    | Improve this Doc View Source

    IEnumerable.GetEnumerator()

    Declaration
    IEnumerator IEnumerable.GetEnumerator()
    Returns
    Type Description
    IEnumerator

    Implements

    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX