Show / Hide Table of Contents

    Class SkipList<T>

    A skip list implementation with IEnumerable support.

    Inheritance
    Object
    SkipList<T>
    Namespace: Advanced.Algorithms.DataStructures
    Assembly: Advanced.Algorithms.dll
    Syntax
    public class SkipList<T> : IEnumerable<T> where T : IComparable
    Type Parameters
    Name Description
    T

    The data type of thi skip list.

    Constructors

    SkipList(Int32)

    Declaration
    public SkipList(int maxHeight = 32)
    Parameters
    Type Name Description
    Int32 maxHeight

    The maximum height.

    Fields

    MaxHeight

    The maximum height of this skip list with which it was initialized.

    Declaration
    public readonly int MaxHeight
    Field Value
    Type Description
    Int32

    Properties

    Count

    The number of elements in this skip list.

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

    Methods

    Delete(T)

    Deletes the given value from this skip list. Will throw exception if the value does'nt exist in this skip list. Time complexity: O(log(n))

    Declaration
    public void Delete(T value)
    Parameters
    Type Name Description
    T value

    The value to delete.

    Find(T)

    Finds the given value in this skip list. If item is not found default value of T will be returned. Time complexity: O(log(n)).

    Declaration
    public T Find(T value)
    Parameters
    Type Name Description
    T value
    Returns
    Type Description
    T

    GetEnumerator()

    Declaration
    public IEnumerator<T> GetEnumerator()
    Returns
    Type Description
    IEnumerator<T>

    Insert(T)

    Inserts the given value to this skip list. Will throw exception if the value already exists. Time complexity: O(log(n))

    Declaration
    public void Insert(T value)
    Parameters
    Type Name Description
    T value

    The value to insert.

    Back to top Generated by DocFX