GATE Computer ScienceModerateGATE CS (PYQ pattern)
Twelve meetings occupy CLOSED time intervals [1,5], [2,6], [5,9], [6,7], [4,8], [7,11], [8,12], [3,10], [9,13], [10,14], [12,15], [13,16]; two meetings that merely touch at an endpoint still conflict. What is the minimum number of rooms needed?
- A. 4
- B. 6
- C. 3
- D. 5
Correct answer: D. 5
The minimum number of rooms equals the maximum number of intervals containing a common point. With closed intervals, at t = 5 the intervals [1,5], [2,6], [5,9], [4,8], [3,10] all contain 5, so 5 rooms are needed, and no point lies in 6 intervals. Treating the intervals as half-open (touching allowed) gives 4.
More Algorithms questions
- The length of the longest bitonic subsequence (strictly increasing and then strictly decreasing; either part may be empty-length-1) of [4…
- Four greedy rules are proposed for choosing the maximum number of mutually non-overlapping activities: I. repeatedly choose the activity…
- Which of the following statements about the 0/1 knapsack problem is/are correct? I. The O(nW) dynamic programme is polynomial in n and in…
- Six tasks have (processing time, deadline): (3,6), (2,8), (4,9), (1,5), (5,15), (2,10). They run one after another on a single machine…
- In how many ways can 12 be written as an ordered sum of parts from {1, 2, 3} such that no two adjacent parts are equal (e.g. 1+2+1+3+… is…
- Which of the following statements about dynamic programming problems is/are correct? I. The LCS of two strings can be computed in O(mn)…