data structures: a pseudocode approach with c1 chapter 4 objectives upon completion you will be able...

40
Data Structures: A Pseudocode Approach with C 1 Chapter 4 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue Implement a queue using a linked list structure Understand the operation of the queue ADT Write application programs using the queue ADT Queues Queues

Upload: bethanie-tucker

Post on 14-Jan-2016

230 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 1

Chapter 4Chapter 4

Objectives

Upon completion you will be able to:

• Explain the design, use, and operation of a queue• Implement a queue using a linked list structure• Understand the operation of the queue ADT• Write application programs using the queue ADT• Explain categorizing data and queue simulation

QueuesQueues

Page 2: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 2

Page 3: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 3

4-1 Queue Operations

This section discusses the four basic queue operations. Using This section discusses the four basic queue operations. Using diagrammatic figures, it shows how each of them work. It diagrammatic figures, it shows how each of them work. It concludes with a comprehensive example that demonstrates each concludes with a comprehensive example that demonstrates each operation.operation.

• Enqueue• Dequeue• Queue Front• Queue Rear• Queue Example

Page 4: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 4

Page 5: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 5

Page 6: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 6

Page 7: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 7

Page 8: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 8

Page 9: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 9

(Continued)

Page 10: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 10

4-2 Queue Linked List Design

We first discuss the data structure for a linked-list implementation. We then develop the eight algorithms required to implement a queue.

• Data Structure Queue

• Algorithms

Page 11: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 11

Page 12: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 12

Page 13: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 13

Page 14: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 14

(Continued)

Page 15: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 15

Page 16: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 16

Page 17: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 17

Page 18: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 18

Page 19: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 19

Page 20: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 20

Page 21: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 21

Page 22: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 22

Page 23: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 23

Page 24: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 24

Page 25: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 25

Page 26: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 26

4-3 Queue ADT

This section develops the data structures and C code to This section develops the data structures and C code to implement a Queue ADT. The first program contains implement a Queue ADT. The first program contains the data structure declarations and a list of the prototypes the data structure declarations and a list of the prototypes for all of the functions. We then develop the C code for for all of the functions. We then develop the C code for the algorithms discussed in Section 4.2the algorithms discussed in Section 4.2

• Queue Structure• Queue ADT Algorithms

Page 27: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 27

Page 28: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 28

Page 29: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 29

Page 30: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 30

Page 31: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 31

Page 32: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 32

Page 33: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 33

Page 34: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 34

Page 35: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 35

Page 36: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 36

Page 37: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 37

Page 38: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 38

Page 39: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 39

Page 40: Data Structures: A Pseudocode Approach with C1 Chapter 4 Objectives Upon completion you will be able to: Explain the design, use, and operation of a queue

Data Structures: A Pseudocode Approach with C 40