Page 167 - DCAP201_FUNDAMENTALS_OF_DATA_STRUCTURES
P. 167
Fundamentals of Data Structures Kamlesh Lakhwani, Lovely Professional University
Notes Unit 10: Queues
CONTENTS
Objectives
Introduction
10.1 Representation of Linear Queue
10.1.1 Sequential Representation of a Queue
10.1.2 Linked List Implementation of a Queue
10.2 Representation of Multiple Queues
10.3 Representation of a Circular Queue
10.3.1 Array Implementation of a Circular Queue
10.3.2 Linked List Implementation of a Circular Queue
10.4 Priority Queue
10.4.1 Array Implementation of Priority Queue
10.4.2 Linked List Implementation of Priority Queue
10.5 Representation of Dequeue
10.5.1 Array Implementation of a Dequeue
10.5.2 Linked List Implementation of a Dequeue
10.6 Summary
10.7 Keywords
10.8 Review Questions
10.9 Further Readings
Objectives
After studying this unit, you will be able to:
Explain the concept of linear queues and its representation
Explain the concept of circular queues and its representation
Explain the concept of priority queues and its representation
Explain the concept of dequeue and its representation
Introduction
A queue is a data collection in which the items are kept in the order in which they were inserted,
and the primary operations are enqueue (insert an item at the end) and dequeue (remove the
item at the front). Because the first item in the queue will be the first one out, queues are known
as a First-In-First-Out (FIFO) data structure. Queue is a linear data structure used in various
applications of computer science. Like people stand in a queue to get a particular service, various
processes will wait in a queue for their turn to avail a service. The word “queue” is like the
queue of customers at a counter for any service, in which customers are dealt with in the order
160 LOVELY PROFESSIONAL UNIVERSITY