Graph Theory37 sections · 1633 units
Open in Course

Quiz: 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 nn nodes?

  1. A.nn
  2. B.n1n - 1
  3. C.The height of the tree
  4. D.The number of leaves
Start the roadmap to answer the quizzes and solve the challenges