Question DSA-TREE-0007
EasyHow many edges does a tree with n nodes have?
- A.
2n
- B.
n − 1
- C.
Show answer and explanation
Answer: B
Every node except the root has exactly one edge to its parent.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Trees question
How many edges does a tree with n nodes have?
2n
n − 1
Answer: B
Every node except the root has exactly one edge to its parent.
n
n + 1