CSE 214 Computer Science II (Spring 2015)
RECITATION 10 – Priority Queue
Objective:
(22, 15, 36, 44, 10, 3, 9, 13, 29, 25).
An airport is developing a computer simulation of air-traffic control that handles events such as landings and takeoffs. Each event has a time stamp that denotes the time when the event will occur. The simulation program needs to efficiently
perform the following two fundamental operations:
• Insert an event with a given timestamp (that is, add a future event).
• Extract the event with a smallest timestamp (that is, determine the next event to process).
insert(5, A), insert(4, B), insert(7, F), insert(1, D), removeMin( ), insert(3, J), insert(6, L), removeMin( ), removeMin( ), insert(8, G), removeMin( ), insert(2, H), removeMin( ), removeMin( )?