SlideShare a Scribd company logo
1 of 14
QUEUE IN DATASTRUCTURE
(BASIC OPERATION)
BY,
LAKSHMI,
ASSISTANT PROFESSOR,
DEPARTMENT OF COMPUTER SCIENCE,
SRI ADI CHUNCHANAGIRI WOMEN’S COLLEGE, CUMBUM.
What is a Queue?
1. A queue can be defined as an ordered list which enables insert operations to be performed at
one end called REAR and delete operations to be performed at another end called FRONT.
• 2. Queue is referred to be as First In First Out list.
• 3. For example, people waiting in line for a rail ticket form a
queue.
Applications of Queue
• Queues are widely used as waiting lists for a single shared resource like printer,
disk, CPU.
• Queues are used in asynchronous transfer of data (where data is not being
transferred at the same rate between two processes) for eg. pipes, file IO, sockets.
• Queues are used as buffers in most of the applications like MP3 media player, CD
player, etc.
• Queue are used to maintain the play list in media players in order to add and
remove the songs from the play-list.
• Queues are used in operating systems for handling interrupts.
Complexity
Data
Structu
re
Time Complexity Space
Compl
eity
Average Worst Worst
Access Search Insertio
n
Deletio
n
Access Search Insertio
n
Deletio
n
Queue θ(n) θ(n) θ(1) θ(1) O(n) O(n) O(1) O(1) O(n)
Basic Operations for Queue in Data Structure
A queue is an object (an abstract data structure - ADT) that allows the following operations:
• Enqueue: Add an element to the end of the queue
• Dequeue: Remove an element from the front of the queue
• IsEmpty: Check if the queue is empty
• IsFull: Check if the queue is full
• Peek: Get the value of the front of the queue without removing it
Enqueue() Operation
The following steps should be followed to insert (enqueue) data element into a
queue -
• Step 1: Check if the queue is full.
• Step 2: If the queue is full, Overflow error.
• Step 3: If the queue is not full, increment the rear pointer to point to the next
available empty space.
• Step 4: Add the data element to the queue location where the rear is pointing.
• Step 5: Here, you have successfully added 7, 2, and -9.
Enqueue() Operation
Dequeue() Operation
Obtaining data from the queue comprises two subtasks: access the data where the
front is pointing and remove the data after access. You should take the following steps
to remove data from the queue -
• Step 1: Check if the queue is empty.
• Step 2: If the queue is empty, Underflow error.
• Step 3: If the queue is not empty, access the data where the front pointer is
pointing.
• Step 4: Increment front pointer to point to the next available data element.
• Step 5: Here, you have removed 7, 2, and -9 from the queue data structure.
Dequeue() Operation
Peek() Operation
This function helps in extracting the data element where the front is pointing without
removing it from the queue. The algorithm of Peek() function is as follows-
• Step 1: Check if the queue is empty.
• Step 2: If the queue is empty, return “Queue is Empty.”
• Step 3: If the queue is not empty, access the data where the front pointer is pointing.
• Step 4: Return data.
isFull() Operation
This function checks if the rear pointer is reached at MAXSIZE to determine that
the queue is full. The following steps are performed in the isFull() operation -
• Step 1: Check if rear == MAXSIZE - 1.
• Step 2: If they are equal, return “Queue is Full.”
• Step 3: If they are not equal, return “Queue is not Full.”
isNull() Operation
The algorithm of the isNull() operation is as follows -
• Step 1: Check if the rear and front are pointing to null memory space, i.e.,
-1.
• Step 2: If they are pointing to -1, return “Queue is empty.”
• Step 3: If they are not equal, return “Queue is not empty.”
Basic Queue Operation in DataStructure.pptx

More Related Content

What's hot

Network security - OSI Security Architecture
Network security - OSI Security ArchitectureNetwork security - OSI Security Architecture
Network security - OSI Security ArchitectureBharathiKrishna6
 
Data link layer
Data link layerData link layer
Data link layersbkbca
 
Binary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of AlgorithmsBinary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of AlgorithmsDrishti Bhalla
 
CS8591 Computer Networks - Unit IV
CS8591 Computer Networks - Unit IVCS8591 Computer Networks - Unit IV
CS8591 Computer Networks - Unit IVpkaviya
 
02 protocols and tcp-ip
02 protocols and tcp-ip02 protocols and tcp-ip
02 protocols and tcp-ipkashish0313
 
Topic: Virtual circuit & message switching
Topic: Virtual circuit & message switchingTopic: Virtual circuit & message switching
Topic: Virtual circuit & message switchingDr Rajiv Srivastava
 
Structure of switches
Structure of switchesStructure of switches
Structure of switchesAnam Sana
 
GAC DS Priority Queue Presentation 2022.ppt
GAC DS Priority Queue Presentation 2022.pptGAC DS Priority Queue Presentation 2022.ppt
GAC DS Priority Queue Presentation 2022.pptCUO VEERANAN VEERANAN
 
Computer network unit 1 notes
Computer network unit  1 notesComputer network unit  1 notes
Computer network unit 1 notesRavi Rajput
 
Chapter 4 data link layer
Chapter 4 data link layerChapter 4 data link layer
Chapter 4 data link layerNaiyan Noor
 
Information and network security 13 playfair cipher
Information and network security 13 playfair cipherInformation and network security 13 playfair cipher
Information and network security 13 playfair cipherVaibhav Khanna
 
Remote invocation
Remote invocationRemote invocation
Remote invocationishapadhy
 
Routing Information Protocol
Routing Information ProtocolRouting Information Protocol
Routing Information ProtocolKashif Latif
 

What's hot (20)

Network security - OSI Security Architecture
Network security - OSI Security ArchitectureNetwork security - OSI Security Architecture
Network security - OSI Security Architecture
 
Queue and its operations
Queue and its operationsQueue and its operations
Queue and its operations
 
Link state routing protocol
Link state routing protocolLink state routing protocol
Link state routing protocol
 
Data link layer
Data link layerData link layer
Data link layer
 
Binary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of AlgorithmsBinary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of Algorithms
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
Cs8591 Computer Networks
Cs8591 Computer NetworksCs8591 Computer Networks
Cs8591 Computer Networks
 
Unit 2
Unit 2Unit 2
Unit 2
 
CS8591 Computer Networks - Unit IV
CS8591 Computer Networks - Unit IVCS8591 Computer Networks - Unit IV
CS8591 Computer Networks - Unit IV
 
02 protocols and tcp-ip
02 protocols and tcp-ip02 protocols and tcp-ip
02 protocols and tcp-ip
 
GO BACK N PROTOCOL
GO BACK N PROTOCOLGO BACK N PROTOCOL
GO BACK N PROTOCOL
 
Topic: Virtual circuit & message switching
Topic: Virtual circuit & message switchingTopic: Virtual circuit & message switching
Topic: Virtual circuit & message switching
 
Structure of switches
Structure of switchesStructure of switches
Structure of switches
 
GAC DS Priority Queue Presentation 2022.ppt
GAC DS Priority Queue Presentation 2022.pptGAC DS Priority Queue Presentation 2022.ppt
GAC DS Priority Queue Presentation 2022.ppt
 
Computer network unit 1 notes
Computer network unit  1 notesComputer network unit  1 notes
Computer network unit 1 notes
 
Chapter 4 data link layer
Chapter 4 data link layerChapter 4 data link layer
Chapter 4 data link layer
 
Information and network security 13 playfair cipher
Information and network security 13 playfair cipherInformation and network security 13 playfair cipher
Information and network security 13 playfair cipher
 
Remote invocation
Remote invocationRemote invocation
Remote invocation
 
Routing ppt
Routing pptRouting ppt
Routing ppt
 
Routing Information Protocol
Routing Information ProtocolRouting Information Protocol
Routing Information Protocol
 

Similar to Basic Queue Operation in DataStructure.pptx

Similar to Basic Queue Operation in DataStructure.pptx (20)

Algorithm and Data Structure - Queue
Algorithm and Data Structure - QueueAlgorithm and Data Structure - Queue
Algorithm and Data Structure - Queue
 
Queue
QueueQueue
Queue
 
Queue Data Structure
Queue Data StructureQueue Data Structure
Queue Data Structure
 
queueppt-191018053228 (1).pptx
queueppt-191018053228 (1).pptxqueueppt-191018053228 (1).pptx
queueppt-191018053228 (1).pptx
 
Stack and queue
Stack and queueStack and queue
Stack and queue
 
Unit-ii-Queue ADT.pptx
Unit-ii-Queue ADT.pptxUnit-ii-Queue ADT.pptx
Unit-ii-Queue ADT.pptx
 
Queue ppt
Queue pptQueue ppt
Queue ppt
 
Queue AS an ADT (Abstract Data Type)
Queue AS an ADT (Abstract Data Type)Queue AS an ADT (Abstract Data Type)
Queue AS an ADT (Abstract Data Type)
 
Queues
Queues Queues
Queues
 
QUEUE PPT BY KULJIT SINGH.pptx
QUEUE PPT BY KULJIT SINGH.pptxQUEUE PPT BY KULJIT SINGH.pptx
QUEUE PPT BY KULJIT SINGH.pptx
 
Unit 3 Stacks and Queues.pptx
Unit 3 Stacks and Queues.pptxUnit 3 Stacks and Queues.pptx
Unit 3 Stacks and Queues.pptx
 
@Chapter 4 DSA Part II.pptx
@Chapter 4 DSA Part II.pptx@Chapter 4 DSA Part II.pptx
@Chapter 4 DSA Part II.pptx
 
Queues
QueuesQueues
Queues
 
01-Introduction of DSA-1.pptx
01-Introduction of DSA-1.pptx01-Introduction of DSA-1.pptx
01-Introduction of DSA-1.pptx
 
Queue Data Structure
Queue Data StructureQueue Data Structure
Queue Data Structure
 
Queues
QueuesQueues
Queues
 
Stack and queue
Stack and queueStack and queue
Stack and queue
 
Data Structures
Data StructuresData Structures
Data Structures
 
unit 5 stack & queue.ppt
unit 5 stack & queue.pptunit 5 stack & queue.ppt
unit 5 stack & queue.ppt
 
VCE Unit 03vv.pptx
VCE Unit 03vv.pptxVCE Unit 03vv.pptx
VCE Unit 03vv.pptx
 

More from LakshmiSamivel

Greedy Algorithm for Computer Science.ppt
Greedy Algorithm for Computer Science.pptGreedy Algorithm for Computer Science.ppt
Greedy Algorithm for Computer Science.pptLakshmiSamivel
 
General methodin Data Structure for UG.pptx
General methodin Data Structure for UG.pptxGeneral methodin Data Structure for UG.pptx
General methodin Data Structure for UG.pptxLakshmiSamivel
 
DIVIDE AND CONQUERMETHOD IN DATASTRUCTURE.pptx
DIVIDE AND CONQUERMETHOD IN DATASTRUCTURE.pptxDIVIDE AND CONQUERMETHOD IN DATASTRUCTURE.pptx
DIVIDE AND CONQUERMETHOD IN DATASTRUCTURE.pptxLakshmiSamivel
 
Classification of datastructure.ppt
Classification of datastructure.pptClassification of datastructure.ppt
Classification of datastructure.pptLakshmiSamivel
 

More from LakshmiSamivel (13)

Greedy Algorithm for Computer Science.ppt
Greedy Algorithm for Computer Science.pptGreedy Algorithm for Computer Science.ppt
Greedy Algorithm for Computer Science.ppt
 
General methodin Data Structure for UG.pptx
General methodin Data Structure for UG.pptxGeneral methodin Data Structure for UG.pptx
General methodin Data Structure for UG.pptx
 
DIVIDE AND CONQUERMETHOD IN DATASTRUCTURE.pptx
DIVIDE AND CONQUERMETHOD IN DATASTRUCTURE.pptxDIVIDE AND CONQUERMETHOD IN DATASTRUCTURE.pptx
DIVIDE AND CONQUERMETHOD IN DATASTRUCTURE.pptx
 
Presentation DM.pptx
Presentation DM.pptxPresentation DM.pptx
Presentation DM.pptx
 
Dos.pptx
Dos.pptxDos.pptx
Dos.pptx
 
Formatting tags
Formatting tagsFormatting tags
Formatting tags
 
Classification of datastructure.ppt
Classification of datastructure.pptClassification of datastructure.ppt
Classification of datastructure.ppt
 
Top down parsing
Top down parsingTop down parsing
Top down parsing
 
Semaphore
Semaphore Semaphore
Semaphore
 
Firewall ppt
Firewall pptFirewall ppt
Firewall ppt
 
View
ViewView
View
 
Procedures andcursors
Procedures andcursorsProcedures andcursors
Procedures andcursors
 
OsI reference model
OsI reference modelOsI reference model
OsI reference model
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 

Recently uploaded (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 

Basic Queue Operation in DataStructure.pptx

  • 1. QUEUE IN DATASTRUCTURE (BASIC OPERATION) BY, LAKSHMI, ASSISTANT PROFESSOR, DEPARTMENT OF COMPUTER SCIENCE, SRI ADI CHUNCHANAGIRI WOMEN’S COLLEGE, CUMBUM.
  • 2. What is a Queue? 1. A queue can be defined as an ordered list which enables insert operations to be performed at one end called REAR and delete operations to be performed at another end called FRONT. • 2. Queue is referred to be as First In First Out list. • 3. For example, people waiting in line for a rail ticket form a queue.
  • 3.
  • 4. Applications of Queue • Queues are widely used as waiting lists for a single shared resource like printer, disk, CPU. • Queues are used in asynchronous transfer of data (where data is not being transferred at the same rate between two processes) for eg. pipes, file IO, sockets. • Queues are used as buffers in most of the applications like MP3 media player, CD player, etc. • Queue are used to maintain the play list in media players in order to add and remove the songs from the play-list. • Queues are used in operating systems for handling interrupts.
  • 5. Complexity Data Structu re Time Complexity Space Compl eity Average Worst Worst Access Search Insertio n Deletio n Access Search Insertio n Deletio n Queue θ(n) θ(n) θ(1) θ(1) O(n) O(n) O(1) O(1) O(n)
  • 6. Basic Operations for Queue in Data Structure A queue is an object (an abstract data structure - ADT) that allows the following operations: • Enqueue: Add an element to the end of the queue • Dequeue: Remove an element from the front of the queue • IsEmpty: Check if the queue is empty • IsFull: Check if the queue is full • Peek: Get the value of the front of the queue without removing it
  • 7. Enqueue() Operation The following steps should be followed to insert (enqueue) data element into a queue - • Step 1: Check if the queue is full. • Step 2: If the queue is full, Overflow error. • Step 3: If the queue is not full, increment the rear pointer to point to the next available empty space. • Step 4: Add the data element to the queue location where the rear is pointing. • Step 5: Here, you have successfully added 7, 2, and -9.
  • 9. Dequeue() Operation Obtaining data from the queue comprises two subtasks: access the data where the front is pointing and remove the data after access. You should take the following steps to remove data from the queue - • Step 1: Check if the queue is empty. • Step 2: If the queue is empty, Underflow error. • Step 3: If the queue is not empty, access the data where the front pointer is pointing. • Step 4: Increment front pointer to point to the next available data element. • Step 5: Here, you have removed 7, 2, and -9 from the queue data structure.
  • 11. Peek() Operation This function helps in extracting the data element where the front is pointing without removing it from the queue. The algorithm of Peek() function is as follows- • Step 1: Check if the queue is empty. • Step 2: If the queue is empty, return “Queue is Empty.” • Step 3: If the queue is not empty, access the data where the front pointer is pointing. • Step 4: Return data.
  • 12. isFull() Operation This function checks if the rear pointer is reached at MAXSIZE to determine that the queue is full. The following steps are performed in the isFull() operation - • Step 1: Check if rear == MAXSIZE - 1. • Step 2: If they are equal, return “Queue is Full.” • Step 3: If they are not equal, return “Queue is not Full.”
  • 13. isNull() Operation The algorithm of the isNull() operation is as follows - • Step 1: Check if the rear and front are pointing to null memory space, i.e., -1. • Step 2: If they are pointing to -1, return “Queue is empty.” • Step 3: If they are not equal, return “Queue is not empty.”