Data Structures & AlgorithmsHardGATE CS · Codeforces Div2 C
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 of vertices such that every edge has at least one endpoint in the set. What is the size of a minimum vertex cover?
- A. 5
- B. 4
- C. 8
- D. 6
Correct answer: A. 5
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: 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…
- A tree has these parent→child edges: 30→54, 20→22, 92→86, 86→30, 27→64, 54→44, 30→32, 35→71, 92→35, 86→20, 67→92, 22→27, 71→13. A vertex…
- A tree has these parent→child edges: 1→17, 80→1, 34→80, 41→8, 84→18, 8→23, 49→84, 47→33, 1→47, 41→9, 34→49, 18→41. A vertex cover is a set…