GATE Computer ScienceVery hardGATE CS · ISRO
Jobs given as (start, finish, profit): (1,4,5), (3,5,1), (0,6,8), (4,7,4), (3,9,6), (5,9,3), (6,10,2), (8,11,4). A job may start exactly when another finishes. What is the maximum total profit of a set of non-overlapping jobs?
- A. 11
- B. 15
- C. 17
- D. 13
Correct answer: D. 13
Weighted interval scheduling DP over finish-sorted jobs gives 13.
More Algorithms questions
- A graph on vertices 0–5 has edges (0,1,1), (1,2,1), (0,2,1), (2,3,2), (1,3,2), (3,4,3), (2,4,3), (4,5,1). How many distinct minimum…
- How many inversions (pairs i<j with A[i]>A[j]) does the array [7, 3, 9, 1, 5, 8, 2] contain?
- Characters with frequencies 5, 9, 12, 13, 16, 45 are Huffman-coded. What is the total number of bits needed to encode the whole text (sum…
- Items have weights 3, 4, 5, 6, 2 and values 4, 5, 10, 11, 3. For the 0/1 knapsack with capacity 10, the maximum total value is
- What is the length of a longest common subsequence of X = "ABCBDABXYZ" and Y = "BDCABAZYX"?
- The edit distance (unit-cost insert, delete, substitute) between "algorithm" and "altruistic" is