Data Structures & AlgorithmsVery hardGATE CS · Codeforces Div 2
Undirected simple graph on vertices A, B, C, D, E, F, G with edges A–B (1), A–E (1), A–G (1), B–C (1), B–F (1), B–G (1), C–F (1), C–G (1), D–E (1), E–F (1), E–G (1), F–G (1) (weights ignored). What is the minimum number of VERTICES whose deletion (together with their incident edges) leaves a bipartite graph?
- A. 3
- B. 2
- C. 4
- D. 6
Correct answer: B. 2
Brute force over vertex subsets gives 2 deleted vertices; deleting edges instead needs 3, which is a different quantity. Confusing vertices with edges is the trap.
Practise more Trees, Graphs, Recursion and Dynamic Programming questionsTrees, Graphs, Recursion and Dynamic Programming: notes and key points
More Trees, Graphs, Recursion and Dynamic Programming questions
- A chain of 6 matrices M1 to M6 has dimensions given by the sequence p = [20, 15, 18, 8, 2, 3, 20], where Mi has size p[i−1] × p[i]…
- Strings a = "bccbc" and b = "bbacaa". The edit distance allows insert, delete and substitute, each costing 1 (the standard Levenshtein…
- Directed acyclic graph on vertices A, B, C, D, E, F, G (every edge goes from a smaller to a larger letter) with weighted edges A→C (9)…
- Undirected weighted graph on vertices A, B, C, D with edges A–B (3), A–C (2), A–D (1), B–C (2), B–D (2), C–D (1). How many distinct…
- Keys [2, 42, 28, 49, 8, 35] are inserted, in this order, into an empty AVL tree using the standard rebalancing (left, right, left–right…
- Distinct words ['a', 'cbb', 'c', 'b'] are inserted into an empty trie (one node per character, shared prefixes share nodes, and a root)…