MassiveSet supports semantics similar to Set, but without the limitation on how much data is stored.

It only supports strings, and stores data in a hierarchy.

const set = new MassiveSet(); // maxDepth=1 default
set.add(`test`);
set.add(`bloorp`);

In the above example, it will create a subtree for the first letter of each key, putting the value underneath it. So we'd get a sub MassiveSet for every key starting with 't' and every one starting with 'b'.

If maxDepth was 2, we'd get the same two top-level nodes, but then another sub-node based on the second character of the value.

It's not a very smart data-structure since it does no self-balancing or tuning.

Constructors

  • Parameters

    • maxDepth: number = 1
    • depth: number = 0

    Returns MassiveSet

Properties

children: Map<string, MassiveSet> = ...
values: string[] = []

Methods

  • Parameters

    • value: string

    Returns void

  • Returns void

  • Parameters

    • value: string

    Returns boolean

  • Returns true if value stored on this node

    Parameters

    • value: string

    Returns boolean

  • Parameters

    • value: string

    Returns boolean

  • Returns the total number of values stored in the set

    Returns number

  • Returns the number of branches at this node Use sizeChildrenDeep to count all branches recursively

    Returns number

  • Returns number

  • Returns the number of values stored in just this level of the set

    Returns number