Home | Projects | Notes > Data Structures & Algorithms > Priority Queues

Priority Queues

 

Introduction

A priority queue is an abstract data structure where each element has a priority, and elements are served based on their priority, not their insertion order.

 

min-heap-max-heap

 

Pros:

Cons:

Usage

 

Implementation (C++)

Header (minpq.hpp)

Source (minpq.cpp)

Test Driver