CS234 Lecture Notes - Binary Tree, Priority Queue, Convoy Pq 13

50 views4 pages

Document Summary

We covered: stacks lifo, queues fifo. Items are removed from the queue (i. e. dequeue) from the front, and items are entered into the queue (i. e. enqueue) from the back. Some applications require the use of a queue in which items are assigned a priority, p >= 0: higher priority items are dequeued first. Items with equal priority still follow the fifo protocol, and are dequeued in the order they were entered. Back of queue pdf | 9 txt | 3 jpg | 3 docx | 5. Calling dequeue will search the queue for the highest priority and remove the first instance of that item. In this example, dequeue will remove the pdf with priority 9. Two types (of priority queues): bounded limited range of priorities, 0 <= p <= m, such that m > 0, unbounded unlimited range of priorities, no bounds on p. L = [10, 12, 4, 1, 9, 13]

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents