Practice mode Data Structures

A tree has 25 nodes. How many edges does it have?

Correct answer C. 24

Explanation

Every node except the root has exactly one edge connecting it to its parent, so a tree with n nodes has n − 1 edges. For 25 nodes that gives 24. Adding one more edge would create a cycle, and removing one would disconnect the tree. The same n − 1 rule is why a spanning tree of a connected graph with V vertices has V − 1 edges.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.