Data Structures · Question 24 · Medium

An undirected simple graph has 6 vertices whose degrees are 3, 3, 2, 2, 2 and 4. How many edges does the graph have?

  1. 16
  2. 8
  3. 9
  4. 6
Answer and explanation

Answer: B. 8

Explanation: Each edge adds 1 to the degree of both its endpoints, so the sum of degrees is twice the number of edges. The sum is 16, so there are 16 / 2 = 8 edges.

Previous: The keys 12, 22, 35, 42, 55, 7, 17 are inserted into a hash table of size 10… · Next: In a doubly linked list, you are given a pointer to a node (not the head or…

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