isLeaf method

bool isLeaf (
  1. T node
)

Returns true if the node is a leaf node, that is without children.

Implementation

bool isLeaf(T node) => childrenCount(node) == 0;