04greedy算法设计与分析 贪心算法(13)

2021-02-21 09:31

Interval Partitioning: Greedy AlgorithmGreedy algorithm. Consider lectures in increasing order of start time: assign lecture to any compatible classroom.Sort intervals by starting time so that s1 s2 ... sn. d 0 number of allocated classrooms for j = 1 to n if (lecture schedule else allocate schedule d d + } { j is compatible with some classroom k) lecture j in classroom k a new classroom d + 1 lecture j in classroom d + 1 1

Implementation. O(n log n). For each classroom k, maintain the finish time of the last job added. Keep the classrooms in a priority queue.


04greedy算法设计与分析 贪心算法(13).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:2013届高三数学二轮复习(8)填空题解题策略精品教学案

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: