卷別
資料結構與演算法
計算國立中興大學 2025 · 考試 · 第 21 題
考科演算法
(5%) You are given the following set of activities, where each activity has a start time and an end time. Your task is to select the maximum number of non-overlapping activities that can be scheduled.
| Activity | Start Time | End Time |
|---|---|---|
| A | 1 | 3 |
| B | 2 | 5 |
| C | 4 | 6 |
| D | 6 | 8 |
| E | 5 | 7 |
| F | 8 | 9 |
Using a greedy algorithm, compute the maximum number of non-overlapping activities that can be selected.