isFull Operation in Queue Structure
This operation returns a boolean value that indicates whether the queue is full or not.
// This function will check
// whether the queue is full or not.
bool isFull()
{
if (front == 0 && rear == MAX_SIZE - 1) {
return true;
}
return false;
}
// Queue is full when size becomes
// equal to the capacity
bool isFull(struct Queue* queue)
{
return (queue->size == queue->capacity);
}
// This code is contributed by Susobhan Akhuli
// This function will check
// whether the queue is full or not.
boolean isFull()
{
if (front == 0 && rear == MAX_SIZE - 1) {
return true;
}
return false;
}
// This code is contributed by aadityapburujwale
# Queue is full when size becomes
# equal to the capacity
def isFull(self):
return self.size == self.capacity
# This code is contributed by Susobhan Akhuli
// Function to add an item to the queue.
// It changes rear and size
public bool isFull(int item) { return (rear == max - 1); }
// This code is contributed by Susobhan Akhuli
// This function will check
// whether the queue is full or not.
function isFull(){
if(front==0 && rear==MAX_SIZE-1){
return true;
}
return false;
}
Introduction to Queue Data Structure
Queue Data Structure is a linear data structure that follows FIFO (First In First Out) Principle, so the first element inserted is the first to be popped out. In this article, we will cover all the basics of Queue, Operations on Queue, its implementation, advantages, disadvantages which will help you solve all the problems based on Queue.
Table of Content
- What is Queue Data Structure?
- Representation of Queue Data Structure:
- Types of Queue Data Structure
- Basic Operations in Queue Data Structure
- 1. Enqueue Operation in Queue Data Structure
- 2. Dequeue Operation in Queue Data Structure
- 3. Front Operation in Queue Data Structure
- 4. Rear Operation in Queue Data Structure
- 5. isEmpty Operation in Queue Data Structure
- 6. isFull Operation in Queue Structure
- Implementation of Queue Data Structure
- Complexity Analysis of Operations on Queue Data Structure
- Applications of Queue Data Structure
- Advantages of Queue Data Structure
- Disadvantages of Queue Data Structure
- FAQs (Frequently asked questions) on Queue Data Structure
Contact Us