UGC-NET Dec 2015 · Asymptotic Analysis & Recurrences

MCQ · 2 marks · Problem PROG-DIVC-0022

In Activity-Selection problem, each activity $i$ has a start time $s_i$ and a finish time $f_i$ where $s_i \leq f_i$. Activities $i$ and $j$ are compatible if
  1. A
    $s_i \geq f_j$
  2. B
    $s_j \geq f_i$
  3. C
    $s_i \geq f_j$ or $s_j \geq f_i$
  4. D
    $s_i \geq f_j$ and $s_j \geq f_i$

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solutionActivity \(i\) occupies the half-open interval \([s_i,f_i)\). Two activities are compatible when their intervals do not overlap, that is, one finishes before the other starts:\[\boxed{s_i\ge f_j\ \ \text{or}\ \ s_j\ge f_i}\](A) and (B) each cover only one of the two possible orders — incorrect.(D) Both conditions together would need \(s_i\ge f_j\ge s_j\ge f_i\ge s_i\), which forces zero-length activities — incorrect.Answer: C

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com