• Counts the number of elements in the tree.

    Type Parameters

    • A

    Parameters

    Returns number

    The number of elements in the tree.

    Examples

    import { empty, fromArray, size } from "./finger-tree.ts";
    import { assertEquals } from "../../deps.ts";

    const emptiness = empty;
    const single = fromArray([3]);
    const many = fromArray([2, 1, 8, 1, 8]);

    assertEquals(size(emptiness), 0);
    assertEquals(size(single), 1);
    assertEquals(size(many), 5);

Generated using TypeDoc