Data Structures · Question 19 · Easy

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

  1. 24
  2. 50
  3. 26
  4. 25
Answer and explanation

Answer: A. 24

Explanation: Every node except the root has exactly one edge to its parent, so a tree with n nodes has n - 1 edges: 25 - 1 = 24.

Previous: A data structure allows insertion and deletion at both the front and the rear… · Next: Which of the following is a non-linear data structure?

Practise data structures

Try a fresh set of data structures questions with an explanation after every answer, free and without signing up: Data Structures practice. Or sit a full placement mock test.

More data structures questions

More technical & programming practice

Algorithms · Object-Oriented Programming · DBMS · SQL · Operating Systems · Computer Networks · Software Engineering · Cloud & DevOps

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge