GATE Computer ScienceHardGATE CS (PYQ pattern)
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. II. If A is NP-hard then B is NP-hard. III. If B ∈ NP then A is NP-complete. IV. If A ∈ P then B ∈ P.
- A. I only
- B. I, II and III only
- C. I and II only
- D. II and IV only
Correct answer: C. I and II only
I follows by running the reduction and then the algorithm for B; II by transitivity of ≤ₚ. III confuses direction (A may be trivially easy), and IV is false: an easy A reduces to a hard B whenever A is trivial.
More Algorithms questions
- 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?
- Two sorted lists of 8 keys each are merged by the standard merge, which stops comparing when one list runs out. All C(16, 8) = 12870…