对于大多数操作,红黑树的执行时间为 O(log n),而以前的调度程序通过具有固定优先级的优先级数组使用 O(1)。
The red-black tree is O(log n) in time for most operations, while the previous scheduler employed O(1), using a priority array with a fixed number of priorities.
这两个函数均按照深度优先的顺序遍历树,但两者的差异在于先访问一个节点还是先访问其子节点。
Both functions walk the tree in depth-first order but they differ in whether a node is visited before or after its children.
找到从最新的顶点到其他顶点的所有边,这些顶点不能在树的集合中。把这些边加入优先级队列。
Find all the edges from the newest vertex to other vertices that aren't in the tree. Put these edges in the priority queue.
To be systematic, I'm going to build this tree depth-first left-first.
为了保持系统性,我将要把这棵树设置,为深度优先和左边优先。
应用推荐