Data Structures & AlgorithmsHardGATE CS · Codeforces Div2 C
A tree has these parent→child edges: 67→97, 32→77, 67→90, 94→38, 97→94, 77→8, 94→32, 67→79, 94→60, 32→72, 32→63. A vertex cover is a set of vertices such that every edge has at least one endpoint in the set. What is the size of a minimum vertex cover?
- A. 7
- B. 5
- C. 4
- D. 6
Correct answer: C. 4
In a tree the minimum vertex cover equals the maximum matching (König's theorem), found greedily from the leaves up. Counting leaves or internal nodes is a common misreading, not the optimum.
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 tree has these parent→child edges: 56→17, 44→56, 25→90, 16→89, 91→16, 63→91, 17→25, 91→44, 91→40. A vertex cover is a set of vertices…
- A tree has these parent→child edges: 40→98, 84→32, 22→82, 68→16, 42→57, 68→42, 42→23, 28→40, 98→84, 82→68, 98→22. A vertex cover is a set…
- A tree has these parent→child edges: 41→32, 58→18, 93→58, 41→93, 94→68, 32→69, 76→88, 69→94, 76→41. A vertex cover is a set of vertices…
- A tree has these parent→child edges: 44→79, 83→17, 75→83, 15→75, 27→20, 79→92, 75→97, 65→15, 75→44, 17→27. A vertex cover is a set of…
- A tree has these parent→child edges: 57→44, 82→6, 57→5, 87→59, 10→37, 5→95, 95→39, 5→87, 37→57, 57→82. A vertex cover is a set of vertices…
- A tree has these parent→child edges: 96→15, 71→48, 50→91, 50→90, 44→37, 50→71, 37→96, 91→44, 96→52, 52→31. A vertex cover is a set of…