GATE Computer ScienceHardGATE CS (PYQ pattern)
Assume P ≠ NP. Which of the following problems have a polynomial-time algorithm? I. 2-SAT. II. 3-colourability of a graph. III. Maximum matching in a general graph. IV. Longest simple path in a DAG. V. Minimum vertex cover in a general graph.
- A. I, III and IV only
- B. I and III only
- C. I, II and IV only
- D. III, IV and V only
Correct answer: A. I, III and IV only
2-SAT (via SCCs), general matching (Edmonds' blossom algorithm) and longest path in a DAG (DP over a topological order) are in P. 3-colourability and vertex cover are NP-complete.
More Algorithms questions
- A polynomial-time many-one reduction from problem A to problem B is given (A ≤ₚ B). Which statements must be true? I. If B ∈ P then A ∈ P…
- Median-of-medians selection with groups of 7 satisfies T(n) ≤ T(n/7) + T(5n/7) + cn (ignore floors). Guessing T(n) ≤ an, what is the…
- Consider T(n) = 2T(n/2) + n/log₂²n for powers of 2, T(1) = 1. Which is the tight asymptotic bound?
- T(n) = 4T(n/2) + n² log₂ n. Which is the tight solution?
- Binary search on a sorted array of 1000 distinct keys uses mid = ⌊(lo + hi)/2⌋ and counts one probe per element compared (the search stops…
- A binary min-heap holds 100 distinct keys in A[1..100]. At how many different positions can the SECOND largest key possibly be?