Show / Hide Table of Contents

    Class SparseSet

    A sparse set implementation.

    Inheritance
    Object
    SparseSet
    Namespace: Advanced.Algorithms.DataStructures
    Assembly: Advanced.Algorithms.dll
    Syntax
    public class SparseSet : IEnumerable<int>

    Constructors

    SparseSet(Int32, Int32)

    Declaration
    public SparseSet(int maxVal, int capacity)
    Parameters
    Type Name Description
    Int32 maxVal
    Int32 capacity

    Properties

    Count

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

    Methods

    Add(Int32)

    Time complexity: O(1).

    Declaration
    public void Add(int value)
    Parameters
    Type Name Description
    Int32 value

    Clear()

    Time complexity: O(1).

    Declaration
    public void Clear()

    GetEnumerator()

    Declaration
    public IEnumerator<int> GetEnumerator()
    Returns
    Type Description
    IEnumerator<Int32>

    HasItem(Int32)

    Time complexity: O(1).

    Declaration
    public bool HasItem(int value)
    Parameters
    Type Name Description
    Int32 value
    Returns
    Type Description
    Boolean

    Remove(Int32)

    Time complexity: O(1).

    Declaration
    public void Remove(int value)
    Parameters
    Type Name Description
    Int32 value
    Back to top Generated by DocFX