区间划分问题Interval Partitioning
问题描述:
Lecture j starts at sj and finishes at fj
Goal:find minimum number of classrooms to schedule all lectures so that no two occur at the same time in the same room.
下面给出一个例子?:
❗算法描述❗:
定义 depth 为 在一段时间内,需要的最多教室数。
(Def:The depth of a set of intervals is the maximum number that pass over and single point on the time-line.)
如:在上面所举的例子中,depth = 3。
按讲座的开始时间,对讲座进行排序。从开始时间最早的讲座开始遍历,