Data Structures & AlgorithmsModerateGATE CS · TCS NQT
Problem: The complete graph K6 has 15 edges. A perfect matching of 3 disjoint edges is removed. How many edges remain?
- A. 15
- B. 9
- C. 12
- D. 3
Correct answer: C. 12
A perfect matching on 6 vertices has 6 / 2 = 3 edges, so 15 − 3 = 12 edges remain. Removing 6 edges (one per vertex) gives 9, 15 forgets the removal, and 3 is the number of edges removed.
More Coding Interview Problems questions
- Problem: What is the chromatic number of the cycle graph C5 (5 vertices in a single cycle)? The chromatic number is the least number of…
- Problem: What is the independence number of the cycle graph C7 (the maximum number of vertices with no two adjacent in the 7-cycle)?
- Problem: The binary search tree is built by inserting 8, 3, 10, 1, 6, 14, 4, 7, 13 in this order. How many nodes lie at the maximum depth…
- Problem: A binary tree is given in level order with None for missing children: [1, 2, 3, None, 4, 5, None, 6]. In this array, node at…
- Problem: The right-side view of a binary tree lists the rightmost node at each depth from top to bottom. For the tree with root 1…
- Problem: A binary tree is given by level order [1, 2, 3, 4, 5, None, 6]. Its diameter is the largest number of edges on any path between…