Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

created min-heap priority queue #699

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions priority_queue/min-heap priority queue
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# min-heap priority_queue

**Description** : priority_queue that arranges elements in ascending order.

**Syntax** : priority_queue<type, vector<type>, greater<type>> pq;

**Example**:
``` cpp

// create a priority queue of int
// arranges elements in ascending order
std::priority_queue<int, vector<int>, greater<int>> numbers;

// add items to priority_queue
numbers.push(1);
numbers.push(20);
numbers.push(7);

// print element with highest priority
cout << "Top element: " << numbers.top();


```