What is the number of edges present in a complete graph having n vertices?

Category: QuestionsWhat is the number of edges present in a complete graph having n vertices?
Editor">Editor Staff asked 4 weeks ago

What is the number of edges present in a complete graph having n vertices?
 
(a) (n*(n+1))/2
 
(b) (n*(n-1))/2
 
(c) n
 
(d) Information given is insufficient
 
The origin of the question is Graph topic in portion Graph of Data Structures & Algorithms I
 
This question was addressed to me in an interview.

1 Answers
Editor">Editor Staff answered 4 weeks ago

Right answer is (b) (n*(n-1))/2
 
Easy explanation – Number of ways in which every vertex can be connected to each other is nC2.