TOC Toolkit API - v0.1.0
    Preparing search index...

    A set of the integers from 0 up to a fixed capacity, which is left out, that remembers the order in which its members arrived. A search uses it as its work list and as its set of visited nodes at once.

    has, add and clear take constant time, and a loop over the members takes time linear in their number. The memory is two integers for every possible member.

    Implements

    • Iterable<number>
    Index
    • Parameters

      • capacity: number

      Returns SparseSet

    capacity: number

    The members are the integers from 0 up to this number, which is left out.

    • get size(): number

      The number of members.

      Returns number

    • Whether member is in the set. A value outside the capacity is in no set.

      Parameters

      • member: number

      Returns boolean

    • Puts member into the set, and returns whether the member is new.

      Parameters

      • member: number

      Returns boolean

    • Takes every member out of the set.

      Returns void

    • Yields the members in the order of insertion. A member that is added during the loop is yielded as well, so the loop of a search ends when the search finds nothing new.

      Returns IterableIterator<number>