counts and returns number of nodes in the tree
if doCount is not null, only nodes for which doCount function returns true will be counted
number of nodes for which doCount(node) returned true
See Implementation
counts and returns number of nodes in the tree
if doCount is not null, only nodes for which doCount function returns true will be counted