to count elements.
The number of elements in the tree.
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
Counts the number of elements in the tree.