queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 queue...

72
1 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 Explain categorizing data and queue simulation Queues Data Structures: A Pseudocode Approach with C , Second Edition

Upload: others

Post on 16-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

1

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

• Explain categorizing data and queue simulation

Queues

Data Structures: A Pseudocode Approach with C , Second Edition

Page 2: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

2

What is a queue ?

A queue is a linear list in which data can be inserted at one end, called the rear, and deleted from the other end, called the front.

It is a first in – first out (FIFO) restricted data structure.

Data Structures: A Pseudocode Approach with C , Second Edition

Page 3: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

3Data Structures: A Pseudocode Approach with C , Second Edition

Page 4: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

4

4-1 Queue Operations

This section discusses the four basic queue operations. Using

diagrammatic figures, it shows how each of them work. It

concludes with a comprehensive example that demonstrates

each operation.

• Enqueue

• Dequeue

• Queue Front

• Queue Rear

• Queue Example

Data Structures: A Pseudocode Approach with C , Second Edition

Page 5: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

5

Queue operations

Enqueue

Dequeue

Queue front

Queue rear

Data Structures: A Pseudocode Approach with C , Second Edition

Page 6: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

6

Enqueue

Enqueue inserts an element at the rear of the queue.

Data Structures: A Pseudocode Approach with C , Second Edition

Page 7: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

7

Dequeue

Dequeue deletes an element at the front of the queue.

Data Structures: A Pseudocode Approach with C , Second Edition

Page 8: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

8

Queue front Queue front retrieves the element at the front of

the queue.

Data Structures: A Pseudocode Approach with C , Second Edition

Page 9: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

9

Queue rear Queue rear retrieves the element at the rear of

the queue.

Data Structures: A Pseudocode Approach with C , Second Edition

Page 10: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

10Data Structures: A Pseudocode Approach with C , Second Edition

Page 11: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

11

(Continued)

Data Structures: A Pseudocode Approach with C , Second Edition

Page 12: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

12

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

Data Structures: A Pseudocode Approach with C , Second Edition

Page 13: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

13

Data structure

Data Structures: A Pseudocode Approach with C , Second Edition

Page 14: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

14

pointer

Data Structures: A Pseudocode Approach with C , Second Edition

Page 15: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

15

Queue algorithms

Create queue

Enqueue

Dequeue

Queuefront

Queuerear

Empty queue

Full queue

Queue count

Destroy queue

Data Structures: A Pseudocode Approach with C , Second Edition

Page 16: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

16Data Structures: A Pseudocode Approach with C , Second Edition

Page 17: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

17

(Continued)

Data Structures: A Pseudocode Approach with C , Second Edition

Page 18: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

18

Create queue

Data Structures: A Pseudocode Approach with C , Second Edition

Page 19: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

19

enqueue

Data Structures: A Pseudocode Approach with C , Second Edition

Page 20: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

20Data Structures: A Pseudocode Approach with C , Second Edition

Page 21: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

21

dequeue

Data Structures: A Pseudocode Approach with C , Second Edition

Page 22: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

22Data Structures: A Pseudocode Approach with C , Second Edition

Page 23: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

23Data Structures: A Pseudocode Approach with C , Second Edition

Page 24: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

24Data Structures: A Pseudocode Approach with C , Second Edition

Page 25: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

25Data Structures: A Pseudocode Approach with C , Second Edition

Page 26: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

26Data Structures: A Pseudocode Approach with C , Second Edition

Page 27: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

Data Structures: A Pseudocode Approach with C 27

Page 28: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

28

4-3 Queue ADT

This section develops the data structures and C code to

implement a Queue ADT. The first program contains

the data structure declarations and a list of the prototypes

for all of the functions. We then develop the C code for

the algorithms discussed in Section 4.2

• Queue Structure

• Queue ADT Algorithms

Data Structures: A Pseudocode Approach with C , Second Edition

Page 29: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

29Data Structures: A Pseudocode Approach with C , Second Edition

Page 30: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

30Data Structures: A Pseudocode Approach with C , Second Edition

Page 31: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

31

傳進來的是儲存資料變數的位址,用區域指標變數來接。

Data Structures: A Pseudocode Approach with C , Second Edition

Page 32: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

32

傳進來的是儲存指到資料變數的指標變數的位址,用區域指標變數(一個指到指標變數的指標變數)來接。

dequeue (queue, (void*)&dataPtr)

Data Structures: A Pseudocode Approach with C , Second Edition

Page 33: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

33

queueFront (queue, (void*)&dataPtr)

Data Structures: A Pseudocode Approach with C , Second Edition

Page 34: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

34

queueRear (queue, (void*)&dataPtr)

Data Structures: A Pseudocode Approach with C , Second Edition

Page 35: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

Data Structures: A Pseudocode Approach with C 35

Page 36: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

Data Structures: A Pseudocode Approach with C 36

Page 37: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

Data Structures: A Pseudocode Approach with C 37

Page 38: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

Data Structures: A Pseudocode Approach with C 38

4-4 Queuing Theory

Queuing theory is a field of applied mathematics that is

used to predict the performance of queues. In this

section we review a few basic queuing theory concepts.

Page 39: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

39

Queuing theory

Queuing theory is a field of applied mathematics that is used to predict the performance of queues.

Data Structures: A Pseudocode Approach with C , Second Edition

Page 40: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

40

Queue types

Single server queue

Provide service to only one customer at a time.

Multiserver queue

Provide service to many customers at a time.

Multiqueues, multiple single-server queues

Data Structures: A Pseudocode Approach with C , Second Edition

Page 41: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

41

Common queue elements

One or more customers

A customer is any person or thing needing service.

Service

The service is any activity needed to accomplish the required result.

Data Structures: A Pseudocode Approach with C , Second Edition

Page 42: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

42

Affected factors

Arrival rate

The rate at which customers arrive in the queue for service.

Service time

The average time required to complete the processing of a customer request.

Data Structures: A Pseudocode Approach with C , Second Edition

Page 43: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

43

Response time

The average time from the point at which customers enter the queue until the moment they leave the server.

queue time + average service time

Queue time The average length of time customers wait in queue

Average service time The average time required to complete the processing of a

customer request.

Data Structures: A Pseudocode Approach with C , Second Edition

Page 44: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

44Data Structures: A Pseudocode Approach with C , Second Edition

Page 45: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

45

4-5 Queue Applications

We develop two queue applications. The first shows how to use a

queue to categorize data. The second is a queue simulator,

which is an excellent tool to simulate the performance and to

increase our understanding of its operation.

• Categorizing Data

• Queue Simulation

Data Structures: A Pseudocode Approach with C , Second Edition

Page 46: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

46

Categorizing data

It is often necessary to rearrange data without destroying their basic sequence.

Example: 3 22 12 6 10 34 65 29 9 30 81 4 5 19 20 57 44 99

We want the list rearranged as shown below.

Less than 10 : 3 6 9 4 5

Between 10 and 19 : 12 10 19

Between 20 and 29 : 22 29 20

30 and greater : 34 65 30 81 57 44 99

Data Structures: A Pseudocode Approach with C , Second Edition

Page 47: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

47

Categorizing data design

Category queues

Fill category queues

Data Structures: A Pseudocode Approach with C , Second Edition

Page 48: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

48Data Structures: A Pseudocode Approach with C , Second Edition

Page 49: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

49Data Structures: A Pseudocode Approach with C , Second Edition

Page 50: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

50Data Structures: A Pseudocode Approach with C , Second Edition

Page 51: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

51

(Continued)

Data Structures: A Pseudocode Approach with C , Second Edition

Page 52: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

52Data Structures: A Pseudocode Approach with C , Second Edition

Page 53: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

53Data Structures: A Pseudocode Approach with C , Second Edition

Page 54: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

54Data Structures: A Pseudocode Approach with C , Second Edition

Page 55: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

55

(Continued)

Data Structures: A Pseudocode Approach with C , Second Edition

Page 56: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

56

(Continued)

Data Structures: A Pseudocode Approach with C , Second Edition

Page 57: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

57Data Structures: A Pseudocode Approach with C , Second Edition

Page 58: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

58Data Structures: A Pseudocode Approach with C , Second Edition

Page 59: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

59Data Structures: A Pseudocode Approach with C , Second Edition

Page 60: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

60

Queue simulation

We build a model of a single-server queue.

the store is open 8 hours per day, 7 days a week.

To simulate a day, we build a model that runs for 480 minutes(8×60).

window

clerkNew customer

queue

Data Structures: A Pseudocode Approach with C , Second Edition

Page 61: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

61

Queue simulation

The simulation use a digital clock that events start and stop in 1-minute intervals.

In each minute of operation, three events will be checked:

The arrival of customers

The start of customer processing

The completion of customer processing

Data Structures: A Pseudocode Approach with C , Second Edition

Page 62: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

62

Events

newCustomer

svcFree (svcStart)

svcComplete

Data Structures: A Pseudocode Approach with C , Second Edition

Page 63: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

63

Data structures

Queue head

Queue node

Customer status

Simulation statistics

Data Structures: A Pseudocode Approach with C , Second Edition

Page 64: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

64Data Structures: A Pseudocode Approach with C , Second Edition

Page 65: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

65

Flag moreCusts

Data Structures: A Pseudocode Approach with C , Second Edition

Page 66: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

66

Queue node

custNum

arriveTime

Data Structures: A Pseudocode Approach with C , Second Edition

Page 67: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

67

custStatus

custNum

arriveTime

startTime

svcTime

Data Structures: A Pseudocode Approach with C , Second Edition

Page 68: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

68

simStatus

numCust

totSvcTime

totWaitTime

maxQueueSize

Data Structures: A Pseudocode Approach with C , Second Edition

Page 69: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

69Data Structures: A Pseudocode Approach with C , Second Edition

Page 70: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

70

An example

Four customers arrive at time 1, 2, 3 and 5.

Data Structures: A Pseudocode Approach with C , Second Edition

Page 71: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

71

An example

clocks

events1 2 3 4 5 6 7 8

newCustomer 1 2 3 4

svcFree

(svcStart)

YES

1

YES

2

YES

3

YES

4

svcCompleteYES

1

YES

2

YES

3

YES

4

Data Structures: A Pseudocode Approach with C , Second Edition

Page 72: Queues - topstep.weebly.comtopstep.weebly.com/uploads/2/4/9/4/24947581/chapter04.pdf · 4-1 Queue Operations This section discusses the four basic queue operations. Using diagrammatic

72Data Structures: A Pseudocode Approach with C , Second Edition