Data Structures & AlgorithmsVery hardICPC regional · approximation
Problem: What guarantee does the maximal-matching heuristic give for vertex cover?
- A. An exact optimum
- B. A 1.5-approximation
- C. No guarantee at all
- D. A 2-approximation: the cover is at most twice the optimum
Correct answer: D. A 2-approximation: the cover is at most twice the optimum
Both endpoints of each matched edge are taken, and any optimal cover must contain one endpoint per matched edge.
More Coding Interview Problems questions
- Problem: Which problem is the standard application of the monotonic deque?
- Problem: What is the expected number of random probes needed in open-addressing hashing with load factor alpha under uniform probing…
- Problem: What is the complexity of checking whether a number n is prime by trial division up to sqrt(n)?
- Problem: Edges of an undirected graph on vertices 0–4 are processed in the given order: e1 = 0-1, e2 = 1-2, e3 = 2-3, e4 = 3-4, e5 = 4-0…
- Problem: How many spanning trees does the cycle graph C5 (5 vertices in one cycle) have?
- Problem: A directed graph on vertices 0–5 has arcs 0→1, 1→2, 2→0, 2→3, 3→4, 4→3, 4→5, 5→1. How many vertices have in-degree equal to…