count<T> static method

int count<T>(
  1. List<TreeNode<T>> roots
)

Total node count.

Implementation

static int count<T>(List<TreeNode<T>> roots) {
  var n = 0;
  walk<T>(roots, (_, __) => n++);
  return n;
}