Data Structures & AlgorithmsVery hardICPC regional · GATE CS top band
Undirected simple graph on vertices A, B, C, D, E, F, G with edges A–C (1), A–D (1), A–F (1), B–D (1), B–E (1), B–F (1), B–G (1), C–E (1), D–G (1), E–F (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. 7
- B. 2
- C. 4
- D. 1
Correct answer: D. 1
Brute force over vertex subsets gives 1 deleted vertices; deleting edges instead needs 2, 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
- Array A = [9, 4, 4, 8, 1, 7, 2] (indices 0 to 6). Count the non-empty subsets of positions (each position used at most once, subsets not…
- On an 7 × 7 chessboard with rows and columns numbered 0 to 6, a knight starts at (2, 2) and must reach (6, 0) (as (row, column)). A knight…
- Connected undirected graph on vertices A, B, C, D, E, F, G, H with edges A–B (1), A–C (1), A–D (1), A–G (1), A–H (1), B–C (1), B–H (1)…
- Directed weighted graph on vertices A, B, C, D with edges (u→v, w): A→B (4); D→C (8); B→A (8); D→B (7); A→C (8). Let d(x, y) be the…
- Array A = [2, 8, 4, 1, 10, 9, 8]. Over all non-empty contiguous subarrays, what is the maximum value of the XOR of the elements in the…
- Weighted tree on vertices 0 to 5 with edges 0–1 (1), 0–2 (9), 2–3 (6), 2–4 (9), 2–5 (6). What is the largest possible sum of edge weights…