Graph Theory37 sections · 1633 units
Open in CourseQuiz: Subtree Size Computation
Knowledge check
Check Your Understanding
You compute subtree sizes using DFS. For each node, size[v] = 1 + sum of size[child] for all children. What is the subtree size of the root in a tree with nodes?
- A.
- B.
- C.The height of the tree
- D.The number of leaves