What is the number of vertices of degree 2 in a path graph having n vertices,here n>2.

Category: QuestionsWhat is the number of vertices of degree 2 in a path graph having n vertices,here n>2.
Editor">Editor Staff asked 1 month ago

What is the number of vertices of degree 2 in a path graph having n vertices,here n>2.
 
(a) n-2
 
(b) n
 
(c) 2
 
(d) 0
 
I’m obligated to ask this question of Undirected Graph in portion Graph of Data Structures & Algorithms I
 
This question was posed to me in an international level competition.

1 Answers
Editor">Editor Staff answered 1 month ago

Right choice is (a) n-2
 
The explanation is: Only the first and the last vertex would have degree 1, others would be of degree 2.