Skip to main content

TreeCount

TreeCount[tree,pattern] gives the number of subtrees of tree whose data matches pattern.

TreeCount[tree,pattern,levelspec] gives the total number of subtrees with data matching pattern that appear at the levels in tree specified by levelspec.

TreeCount[pattern] represents an operator form of TreeCount that can be applied to a tree.

Please visit the official Wolfram Language Reference for more details and examples on core symbols.