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–C (1), B–D (1), B–F (1), C–F (1), D–F (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. 1
- B. 2
- C. 7
- D. 4
Correct answer: A. 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
- Undirected simple graph on vertices A, B, C, D, E, F, G with edges A–D (1), B–C (1), B–E (1), B–F (1), B–G (1), C–D (1), C–F (1), C–G (1)…
- Undirected weighted graph on vertices A, B, C, D, E, F with edges A–B (4), A–C (5), A–D (6), C–D (5), C–E (7), D–E (5), D–F (5), E–F (6)…
- Array [13, 15, 17, 14, 6, 23, 3] is turned into a min-heap in place with bottom-up heapify: for i from ⌊n/2⌋−1 down to 0, sift the element…
- Keys [12, 24, 3, 18, 30, 33, 7, 16, 4] are inserted, in this order, into an empty AVL tree using the standard rebalancing (left, right…
- Distinct keys [13, 24, 18, 4, 20] are inserted, in the order given by the sequence [18, 20, 4, 24, 13], into an empty binary search tree…
- Distinct words ['baa', 'c', 'b', 'bac', 'bba', 'cbbc'] are inserted into an empty trie (one node per character, shared prefixes sharing…