Data Structures & AlgorithmsVery hardICPC regional · GATE CS top band
Undirected simple graph on vertices A, B, C, D, E, F, G with edges A–D (1), B–C (1), B–E (1), C–D (1), C–E (1), D–E (1), D–G (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. 2
- B. 7
- 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
- Directed acyclic graph on vertices A, B, C, D, E, F, G (edges go from earlier to later letters) with weights A→C (4), A→F (1), B→D (2)…
- Directed graph on vertices A, B, C, D, E, F with edges F→D, C→F, A→D, A→C, F→E, F→C, B→E (no weights). What is the number of vertices in…
- Undirected weighted graph on vertices A, B, C, D with edges A–B (3), A–C (2), A–D (1), B–C (1), B–D (2). How many distinct minimum…
- Weighted tree on vertices 0 to 8 with edges 0–1 (6), 1–2 (7), 0–3 (8), 0–4 (1), 0–5 (1), 5–6 (6), 2–7 (2), 4–8 (2). What is the largest…
- Array A = [25, 23, 7, 3, 1] (all values below 32). What is the maximum of A[i] XOR A[j] over all index pairs with 0 ≤ i < j < 5?
- Keys are inserted in the order 51 18 15 34 11 into an empty binary search tree. Then the key 18 (which has two children) is deleted by…