Data Structures & AlgorithmsVery hardProduct-company placement
What is the minimum number of edges that must be deleted from the undirected graph with edges A–B, A–D, A–E, B–D, B–F, C–D, C–E, D–E, E–F to make it bipartite?
- A. 1
- B. 2
- C. 3
- D. 4
Correct answer: B. 2
Deleting edges to reach a bipartite graph = keeping a maximum cut. The best 2-colouring cuts 7 of the 9 edges, so 2 must go. Counting independent cycles (E − V + 1 = 4) is not the answer.
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
- An undirected connected graph has edges A–C, B–D, B–F, B–H, C–D, C–F, D–G, D–I, E–H, F–G. How many articulation points (cut vertices) and…
- Coins of denominations 1, 9, 10, 11 are available in unlimited supply. What is the minimum number of coins needed to make 18, and how many…
- A BST holds integer keys between 1 and 100. Which sequence CANNOT be the sequence of keys examined while searching for 46?
- Dijkstra's algorithm runs from A on the directed graph A→B (6), A→E (1), A→F (11), B→C (9), B→D (2), B→F (1), C→D (10), C→F (11), D→A (5)…
- With 3 identical eggs and at most 7 drops, what is the largest number of floors for which you can always determine the critical floor (the…
- 0/1 knapsack with capacity 18: items (weight, value) = (8, 39), (2, 16), (3, 24), (6, 38), (3, 36). What is the maximum total value?