Data Structures & AlgorithmsVery hardICPC regional · GATE CS top band
Undirected simple graph on vertices A, B, C, D, E, F, G with edges A–B (1), A–C (1), A–G (1), B–G (1), C–D (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. 2
- B. 4
- C. 1
- D. 7
Correct answer: C. 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
- A binary trie of 6-bit numbers stores the set S = [23, 17, 24, 54, 21, 27, 41]. For the query x = 40, what is the maximum value of x XOR s…
- 2 × 3 sliding puzzle with tiles 1 to 5 and one blank (shown as ). Current board: 4 2 / 5 1 3. Goal board: 1 2 3 / 4 5 . A move slides a…
- Distinct words ['ca', 'a', 'ba', 'abc', 'b'] are inserted into an empty trie (one node per character, shared prefixes share nodes, and a…
- Undirected weighted graph on vertices A, B, C, D, E with edges A–C (2), A–D (3), A–E (1), B–C (3), B–E (3), C–D (3), D–E (3). An edge is…
- A trie keeps a counter at each node, and every word of the list W = ['c', 'accb', 'bbcb', 'c', 'cacb', 'b', 'bccb', 'c'] is inserted once…
- Array A = [7, 11, 5, 8, 11, 8]. Over all non-empty contiguous subarrays, what is the maximum value of the XOR of the elements in the…