Professional Documents
Culture Documents
L9 Queues PDF
L9 Queues PDF
CptS 122
• A queue is referred to as a first-in, first-out (FIFO)
data structure
• A queue is also considered a restricted or
constrained list
Queues
Queue Operations
• Constructor • isEmpty()
• Destructor • clear()
• enqueue()
• dequeue()
Queue Class Implementation
• Hence, you can use an array as the underlying structure for the queue
• A queue is essentially a restricted linked list, where one additional pointer is needed to
keep track of the back, tail, or rear of the queue
Write a program that opens two text files
and reads their contents into two
separate queues. The program should
then determine whether the files are
identical by comparing the characters in
Example Problem: the queues. When two nonidentical
characters are encountered, the program
files_queuesMain.cpp should display a message indicating that
the files are not the same. If both queues
contain the same set of characters, a
message should be displayed indicating
that the files are identical.