×
Home Discussions Write at Opengenus IQ
×
  • Track your progress
  • Deep Learning Projects
  • Python Projects
  • Join our Internship 🎓
  • RANDOM
  • 100+ Graph Algorithms
  • 100+ DP Problems
  • 50+ Linked List Problems
  • 50+ Array Problems
  • One Liner
  • 50+ Binary Tree problems
  • Home
  • Rust Projects

queue

A collection of 31 posts

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 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
Data Structures

Priority Queue

Priority queue is an abstract data type which is like a queue or stack data structure with each element having a priority assigned to it. In priority queue, an element with highest priority assigned is served first, if two elements have same priority then they are served according to enqueue order

Sadanand Vishwas Sadanand Vishwas
Data Structures

Implementing Stack using queues in two ways

A stack is based on the principle of Last-in-First-Out(LIFO). It is commonly used abstract data type with two major operations, namely pop and push. Push() and pop() are carried out in the topmost element, which is the item most recently added to the stack. Push operation adds an element to stack

Vaibhav Gupta
C++

Queue in C++ STL

Queue in the STL of C++ is a dynamically resizing container to implement the queue data structure. It is a sequential linear container which follows the First In First Out(FIFO) arrangement. We explore the various functions like empty, size, swap, emplace, front, back, push and pop operations

Arvind Tatiparti
OpenGenus IQ © 2023 All rights reserved â„¢ [email: team@opengenus.org]
Top Posts LinkedIn Twitter