CSCI 1030U Lecture Notes - Lecture 34: Priority Queue, Circular Buffer, Linked List

110 views6 pages
23 Nov 2017
School
Professor

Document Summary

Queue -> os figuring out how to spread the memory between the processes. How priority queue works (which program should be prioritized == the program that is running) At first, both points at front (line is empty) Where it should be inserted (front) -> enqueue. Where it should be removed (back) ->dequeue. Enqueue -> front stays the same, back increment by 1. Issue: the empty space at the front won"t be automatically replaced, so the queue gets further backwards -> migrating values". And you also need to allocate a list big enough (but what is the size?) Double linked list has 2 pointers (prev & next) At first, front and back point to null. Enqueue (empty queue) -> make a node (data + pointer next" = null) Enqueue -> make a node (the new node"s next" is null, the previous one points. Last dequeue -> front points to null (therefore set back to null) == empty queue.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents