×
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

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

Circular Queue / Ring Buffer / Circular Buffer

Circular Queue (Ring Buffer) is also a linear data structure, which follows the principle of FIFO(First In First Out), but instead of ending the queue at the last position, it again starts from the first position after the last, hence making the queue behave like a circular data structure.

Vedant Wakalkar Vedant Wakalkar
Data Structures

Implementing Queue using Stack in two ways

Queue is an abstract data structure similar to Stacks. Queue is open at both its ends. One end is always used to insert data (enqueue) and the other is used to remove data (dequeue). For implementing queue using stack, one method is to make dequeue costly and other is to make enqueue costly

Kavita Bisht
Algorithms

Cartesian tree sorting

Cartesian tree sorting, also called Levcopoulos Petersson algorithm is an adaptive sorting algorithm, i.e. it performs much better on a partially sorted data. It needs two data structures a Cartesian tree and a priority queue. The algorithm here uses min-heap Cartesian tree to give a sorted sequence

Yash Aggarwal Yash Aggarwal
Data Structures

Implementing Queue using Linked list

A queue (First in First out) is an ordered collection of items where the addition of new items happens at one end, called the rear, and removal of existing items occurs at the other end called front. It can be implemented using Linked Lists which brings many advantages over array implementation

Akshit Desai Akshit Desai
Data Structures

Queue

Queue is a linear data structure that can be used to store data in order by imposing rules on data insertion and deletion. It has found immense use and can be implemented using arrays and linked lists. The operations include enqueue and dequeue which are of O(1) time complexity with space of O(N)

Gaurav Kumar Ponkiya Gaurav Kumar Ponkiya
double ended queue

Double Ended Queue (Deque)

A double ended queue also called as deque (pronounced as ‘deck’ or ‘dequeue’) is a list in which the elements can be inserted or deleted at either end in constant time.

Pankaj Sharma Pankaj Sharma
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