L3_Queue - What are Queues The second Data Structure that...

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

View Full Document Right Arrow Icon
What are Queues The second Data Structure that we learn is called a queue . Operations: Join at the tail of a queue. Leave from the head of a queue. Page 1 of 26
Background image of page 1

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

View Full DocumentRight Arrow Icon
What are Queues In computer science, we use queues to store values. 8 7 10 3 4 7 enqueue 8 10 3 4 7 10 3 Queue of integers 4 2 4 23 6 15 dequeue 2 4 23 6 2 4 23 6 Queue of integers 15 Page 2 of 26
Background image of page 2
What are Queues In computer science, we use queues to store values. 'p' 'n' 'e' 'v' 'b' 'n' enqueue 'p' 'e' 'v' 'b' 'n' 'e' 'v' Queue of characters 'b' 'k' 's' 'c' 'g' 'i' dequeue 'k' 's' 'c' 'g' 'k' 's' 'c' 'g' Queue of characters 'i' Page 3 of 26
Background image of page 3

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

View Full DocumentRight Arrow Icon
What are Queues Of course, we also have queues of floats, queues of shapes, etc. , but we are not going to show them here. Queue of floats Queue of shapes Queue of Page 4 of 26
Background image of page 4
Queue Operations The enqueue operation inserts a new element at the rear of a queue. enqueue Page 5 of 26
Background image of page 5

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

View Full DocumentRight Arrow Icon
The dequeue operation deletes and returns the element at the front of a queue. dequeue
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/28/2010 for the course CSC CSC1110 taught by Professor Cjyuan during the Fall '06 term at CUHK.

Page1 / 26

L3_Queue - What are Queues The second Data Structure that...

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

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