Data Structures & AlgorithmsHardICPC regional · Product Company SDE
Problem: Maximum bipartite matching is computed for left side {A, B, C, D} and right side {1, 2, 3, 4} with allowed pairs: A–1, A–2, B–2, B–3, C–1, C–3, D–3, D–4. How many left vertices can be matched in a maximum matching?
- A. 4
- B. 5
- C. 3
- D. 6
Correct answer: A. 4
Kuhn's augmenting-path algorithm finds the maximum matching size. Greedily matching each left vertex to its first free neighbour can leave an augmenting path unexplored.
More Coding Interview Problems questions
- Problem: A tree has 8 nodes numbered 1–8 with edges 1-2, 1-3, 2-4, 2-5, 3-6, 3-7, 7-8. What is the size of a minimum vertex cover (a…
- Problem: In the directed graph on vertices 1–6 with arcs 1→2, 1→3, 2→4, 3→4, 4→5, 3→6, 6→5, what is the length of the longest directed…
- Problem: A binary tree is given in preorder (root first, then left subtree, then right subtree) as 8, 3, 1, 6, 4, 7, 10, 14, 13 and…
- Problem: For the binary tree with root value 2 and children: 2 has left child 3 and right child 9; 3 has left child 1 and right child 5; 9…
- Problem: The string "banana" has its longest repeated substring (a substring occurring at least twice, overlaps allowed) of length L. What…
- Problem: How many subsequences equal to the string "abc" are contained in "aabbcbcac" (a subsequence picks positions in increasing order…