Also called Interval scheduling and Earliest finish time first.
fresh numbers
The test's questions that a run answers, asked again on new numbers whenever you like. The answer, its working and the reason for every other choice come from activity selection's own run on the numbers shown.
choose one
1question 1
These four activities are typed in this order: A from 1 to 2, B from 6 to 7, C from 2 to 6 and D from 6 to 9. The drawing lines them up by end. How many comparisons does the sort make?
the answer, and why
the answer is D
Round 1 sorts each pair, 1 comparison each: A with B, then C with D. Round 2 merges ends 2, 7 with 6, 9, 3 comparisons. That is 5 in all.
if you chose another
A4 is the drawing's order, ends 2, 6, 7, 9; the sort meets them as typed, 2, 7, 6, 9.
BThat counts only the checks after the sort, one for each activity after the first.
CThat counts round 2 as 4, but the last activity follows with no comparison.