Computer Science EngineeringVery hard
A simple undirected graph has 10 vertices and exactly 3 connected components. What is the maximum possible number of edges?
- A. 28
- B. 36
- C. 21
- D. 45
Correct answer: A. 28
The maximum is (n-k)(n-k+1)/2 = 7*8/2 = 28, obtained by one clique on 8 vertices and two isolated vertices.
Practise more Algorithms, Data Structures & Programming (ISRO CS) questionsAlgorithms, Data Structures & Programming (ISRO CS): notes and key points
More Algorithms, Data Structures & Programming (ISRO CS) questions
- How many distinct spanning trees does the complete graph K4 have?
- The best-case running time of insertion sort (already sorted input) is
- The recurrence T(n) = T(sqrt(n)) + 1 has the solution
- Prim's algorithm on a graph stored as an adjacency matrix with a simple array for minimum selection runs in
- The postfix form of the infix expression a + b c - d is
- The length of a longest common subsequence of ABCBDAB and BDCABA is