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

priority queue

A collection of 7 posts

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

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

Rearrange string such that no two adjacent characters are same

In this problem, we have to rearrange the characters of the string such that no two adjacent characters are same. To solve this efficiently in O(N log N) time, we will use priority queue data structure.

Shujaa Ahmad Shujaa Ahmad
Data Structures

Leftist Heap

A leftist heap is a modification priority queue implemneted with variant of binary heap. Regarding binary heap, it is always a complete binary tree. It has two main properites Mean Heap Property and Heavy on left side and supports common operations in O(log N) time complexity.

Nisarg Shah Nisarg Shah
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
C++

Priority Queue in C++ STL

Priority queue in the STL of C++ is a dynamically resizing container to implement the special case of priority queye under the queue data structure. It is a sequential linear container. The top element of the priority queue is the greatest with all elements arranged in non-increasing order.

Arvind Tatiparti
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
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