SUNY Geneseo Department of Computer Science
{Date}
CSci 240, Spring 2007
Prof. Doug Baldwin
Lab 13 due tomorrow (Tuesday)
CSci end-of-semester mixer
SOFIs
Final exam
"Priority queue" is defined by interface
Frequently implemented as a heap, but that's not essential to being a priority queue
Relation between priority queue and heap is much like relation between dictionary and ordered tree
Some uses of priority queues
Simulator
// keep events in priority queue, by time 'til due
q.addItem( first event )
while ( ! q.isEmpty() ) {
e = q.retrieveByPriority()
process e, e.g.,
collect statistics
update simulated time
create subsidiary events
q.addItem( new Event(time) )
etc.
Prioritized scheduling
triangulate primitives
insert triangles into a priority queue
while queue not empty
retrieve a triangle
split it
insert any sub-triangles into priority queue