Skip to content

Commit

Permalink
Add day 45
Browse files Browse the repository at this point in the history
  • Loading branch information
MadhavBahl committed Feb 20, 2019
1 parent e8a9631 commit 7919061
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -72,6 +72,7 @@ Motivate yourself to code daily till 60 days, and see the magic! Coding will bec
| [Day 42](./day42) | [Alternate Queue Combination](./day42) | [http://codetoexpress.tech/dc/day42/](http://codetoexpress.tech/dc/day42/) | **intermediate** |
| [Day 43](./day43) | [Queue Reversal](./day43) | [http://codetoexpress.tech/dc/day43/](http://codetoexpress.tech/dc/day43/) | **intermediate** |
| [Day 44](./day44) | [Queue from Stacks](./day44) | [http://codetoexpress.tech/dc/day44/](http://codetoexpress.tech/dc/day44/) | **intermediate** |
| [Day 45](./day45) | [Priority Queue](./day45) | [http://codetoexpress.tech/dc/day45/](http://codetoexpress.tech/dc/day45/) | **intermediate** |

## [More Problems](./BONUS/README.md)

Expand Down
Binary file removed day44/ques.png
Binary file not shown.
1 change: 1 addition & 0 deletions day45/JavaScript/priorityQueue.js
@@ -0,0 +1 @@
// To Be Added
31 changes: 31 additions & 0 deletions day45/README.md
@@ -0,0 +1,31 @@
![cover](./cover.png)

# Day 45 - Implement a priority queue

Implement the Priority Queue data structure

### Priority Queue

Priority Queue is an extension of queue with following properties

1. Every item has a priority associated with it.
2. An element with high priority is dequeued before an element with low priority.
3. If two elements have the same priority, they are served according to their order in the queue.

A typical priority queue supports following operations.

1. **insert(item, priority):** Inserts an item with given priority.
2. **getHighestPriority():** Returns the highest priority item.
3. **deleteHighestPriority():** Removes the highest priority item

[Read More (Geeks4Geeks)](https://www.geeksforgeeks.org/priority-queue-set-1-introduction/)

## Solution

## JavaScript Implementation

### [Solution](./JavaScript/priorityQueue.js)

```js
// To Be Added
```
Binary file added day45/cover.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7919061

Please sign in to comment.