Data Structures & AlgorithmsHardCodeforces Div 2 · ICPC regional
Bipartite graph with left side {A, B, C}, right side {D, E, F, G} and edges A–D, A–F, B–D, B–F, B–G. What is the size of a maximum matching (largest set of edges with no shared endpoint)?
- A. 3
- B. 4
- C. 2
- D. 5
Correct answer: C. 2
Trying every set of disjoint edges gives a maximum matching of size 2. Counting the edges, or assuming the smaller side is always matched, gives a wrong 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
- Directed weighted graph on vertices A, B, C, D, E with edges (u→v, w): E→C (9); C→D (5); C→E (4); A→C (5); B→E (1); C→A (3); E→A (2); B→C…
- Keys [43, 27, 29, 8, 44, 17, 18, 5, 4] are inserted, in this order, into an empty AVL tree using the standard rebalancing (left, right…
- Directed weighted graph on vertices F, E, D, A, B (source F, target B) with edges: F→E (4); F→D (6); D→E (-3); E→B (1); D→B (6); F→B (11)…
- Directed weighted graph on vertices A, B, C, D with edges B→A (1); B→C (5); C→D (-1); B→D (-1); C→A (-1); D→C (-2); A→D (4). Source A. Run…
- Words ['aad', 'cda', 'bb', 'aaa', 'cbc', 'cdb'] (each may be used at most once). A chain is a sequence of these words in which the first…
- Words ['aa', 'acb', 'caa', 'caa', 'cbba', 'c'] are inserted in this order into an empty trie with one node per character, shared prefixes…