Search problems

1 problem matches “binary trees”. Clear

Visitors search a sample. Sign in for free to search every problem. Sign in

  1. 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 00. The root's left child has value 11 and is a leaf. The root's right child has value 00; its left child has value 11 and its right child has value 00 (a leaf). The node with value 11 (the left child of the right child) has two children, both with value 11 (leaves). How many unival subtrees does the tree have?