11-Queues___Deques

11-Queues___Deques - Queue Queue First In / First Out...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Queue – First In / First Out (FIFO) data structure that supports two operations: - push for adding new element at the end of the queue - pop for removing new element at the front of the queue Queue Queue
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Queue: Push Queue: Push Max Lex Nika Vlad Push Joe top Max Lex Nika Vlad Joe top
Background image of page 2
Queue: Pop Queue: Pop pop Lex Nika Vlad Joe Max Lex Nika Vlad Joe top Max
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
#include <queue> queue<string> myQueue; size() returns queue size; front() returns the front queue element; push () adds new element to (the end of) the queue; pop() removes element from (the front of) the queue; Generic queue Class (STL) Generic queue Class (STL)
Background image of page 4
Various lists: print queues, message queues, service request queues, process / thread queues; O(1) Round robin: circular queue (front element linked to last. Applications Applications
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
A queue can be implemented with the help of a linked list: Implementation Implementation Max Lex Nika Vlad end front
Background image of page 6
DEQueue – D ouble-E nded Queue = stack + queue hybrid, supports
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/18/2010 for the course CSE 122 taught by Professor Yoxheimer,ericch during the Spring '07 term at Penn State.

Page1 / 12

11-Queues___Deques - Queue Queue First In / First Out...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online