×
Home Discussions Write at Opengenus IQ
×
  • DSA Cheatsheet
  • HOME
  • Track your progress
  • Deep Learning (FREE)
  • Join our Internship 🎓
  • RANDOM
  • One Liner

queue

A collection of 34 posts

Algorithms

Quick Sort using Queue

In this OpenGenus, we have explored how to implement Quick Sort using Queue data structure. Usually, stack data structure is used with Quick Sort.

Kazi Priom Kazi Priom
JavaScript

Queue Data Structure in JavaScript [with OOP]

In this article at OpenGenus, we will delve into the queue data structure in JavaScript, understand its underlying principles, and learn how to implement and utilize queues effectively.

Mizbaul Haque Maruf Mizbaul Haque Maruf
Python

Queue in Python using OOP concepts

In this article at OpenGenus, we will explore the implementation of a Queue in Python using the principles of Object-Oriented Programming (OOP). By utilizing OOP concepts in Python, we can create and manipulate queues in a structured and efficient manner.

MATHANKUMAR V
queue

Dynamic Queue

In this article, we will see what a dynamic queue is and how it is implemented. In short, Dynamic Queue is a Queue whose allocated memory may increase or decrease depending on the number of elements being inserted or deleted in Queue.

Ali Haider Ali Haider
Algorithms

Stack vs Queue [Differences]

In this article, we will be discussing about "Stack vs Queue" in detail.

Uddeshya Raj
queue

K queues in an array

In this article, we have explained 2 approaches to implement K queues in a single array. The challenge is that the space of the array should be utilized optimally by the K queues.

Gabriel
queue

Interleave first half of Queue with second half

In this article, we are going to explore an algorithm to interleave first half of queue with second half.

Gifty Treesa Iju Gifty Treesa Iju
Algorithms

2 queues in a single array

In this article, we have presented 2 different approaches to implement 2 Queue Data Structure using a single Array Data Structure.

Gabriel
Algorithms

Reverse a Queue using Stack

In this article, we have explored how to reverse a Queue using Stack data structure.

Rahul Kumar Rahul Kumar
Algorithms

Reverse a Queue using another Queue

In this article, we will explore how to reverse a Queue using another Queue.

Roshni Verma
Time Complexity

Time and Space Complexity of Queue

This article is about the analysis of time and space complexity of queue operations. With this, we will also learn what the time and space complexity are and how we can calculate the time and space complexity of an algorithm.

Susmita Bhattacharya
Algorithms

Delete middle element of Queue

In this article, we discuss how to delete the middle element of a queue without using other data structures. We have explained both iterative and recursive approach.

Erick Lumunge
Algorithms

Invert / Reverse a Binary Tree [3 methods]

Inverting a binary tree is one of the most common questions asked in the interviews of many companies. In this article, we will see in detail as to how one can understand and tackle this task of inverting a binary tree using recursion, stack and queue.

Sanjana Babu
Algorithms

Shortest Subarray with at least K as sum

In this problem, we find the length of the Shortest Subarray with at least K as sum. This can be solved in O(N) time complexity. This brings in the ideas of Monotonic Queue and Sliding Window.

Sumit Kumar
Algorithms

132 Pattern Problem [Solved]

In this article, we have explained what is 132 pattern problem and have discussed 3 different approaches to solve it in linear time O(N) where brute force approach takes O(N^3) time.

Vikram Shishupalsingh Bais Vikram Shishupalsingh Bais
Algorithms

Different ways to sort a Queue

We will be discussing 4 different ways to sort a queue. This involves sorting a Queue using auxiliary array, O(1) space, using recursion and using a stack.

Tushti
Algorithms

Reverse first K elements of Queue using Stack

To reverse the first K elements of a queue, we can use an auxiliary stack. We push the first k elements in the stack and pop() them out so and add them at the end of the queue.

Tushti
Algorithms

Next Larger / Smaller element in Array (using Monotonic Queue)

In this problem, we are given an array and our task is to find the next larger/ smaller element for each element in the array. We have covered brute force approach and Monotonic Queue.

Raghavendra Achar C
Algorithms

Implementing Priority Queue using Linked List

We demonstrated the approach to Implement a Priority Queue using Linked List and support all operations like push and pop efficiently.

Vikranth R Gaddam Vikranth R Gaddam
Algorithms

Maximal Rectangle problem (using Monotonic queue)

We have solved the maximal rectangle problem using Monotonic queue. In this problem we are given a matrix consisting of only 0's and 1's, we need to find the largest rectangle consisting of only 1's and return its area.

Raghavendra Achar C
Algorithms

Monotonic Queue (with Daily Temperatures & Largest Rectangle in Histogram)

Monotonic queue is a data structure where the data is entirely in non-decreasing order or entirely in non-increasing order. It is generally used for optimizing dynamic programming techniques.

Raghavendra Achar C
Data Structures

Applications of Queue

We have covered all applications of queue. Some of the algorithms were it is used are CPU Scheduling (First-Come-First-Serve), Breadth First Search Traversal, Level Order Traversal of a tree, Edmonds Karp Algorithm, Dinic's Algorithm and Fibonacci Heap. We have explored some of the problems as well.

Shruti Rawal Shruti Rawal
Data Structures

Types of Queue and their implementations

Queue is a FIFO (first in first out) data structure. The different types of queues are linear queue, circular queue, priority queue and deque. We have explored the types along with implementations.

Shruti Rawal Shruti Rawal
Algorithms

Queue using Array

In this article, we have explored how to implement queue using array and explored various operations such as enqueue, dequeue, display, front and size. We have provided implementation in C and Python as well.

Believe Manasseh Amadi Believe Manasseh Amadi
Software Engineering

Learn to use Queue in Java Collections Framework

In this article, we will take a look at how to use the Queue class in Java Collections library. This is useful as one can directly use queue without natively implementing it

Chaitanyasuma Jain Chaitanyasuma Jain
OpenGenus IQ © 2025 All rights reserved â„¢
Contact - Email: team@opengenus.org
Primary Address: JR Shinjuku Miraina Tower, Tokyo, Shinjuku 160-0022, JP
Office #2: Commercial Complex D4, Delhi, Delhi 110017, IN
Top Posts LinkedIn Twitter
Android App
Apply for Internship