Search problems
1 problem matches “binary trees”. Clear
Visitors search a sample. Sign in for free to search every problem. Sign in
- Count unival subtrees in a tree ●●○○○ 20 ptsA unival subtree of a binary tree is a subtree in which all nodes have the same value. A single leaf counts as a unival subtree. Consider the following binary tree. The root has value . The root's left child has value and is a leaf. The root's right child has value ; its left child has value and its right child has value (a leaf). The node with value (the left child of the right child) has two children, both with value (leaves). How many unival subtrees does the tree have?