Skip to content

Commit

Permalink
Add day 46 - deque
Browse files Browse the repository at this point in the history
  • Loading branch information
MadhavBahl committed Feb 21, 2019
1 parent 7919061 commit cab1ced
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 4 deletions.
7 changes: 4 additions & 3 deletions README.md
Expand Up @@ -69,10 +69,11 @@ Motivate yourself to code daily till 60 days, and see the magic! Coding will bec
| [Day 39](./day39) | [Maximum Element and Reverse Stack](./day39) | [http://codetoexpress.tech/dc/day39/](http://codetoexpress.tech/dc/day39/) | **Intermediate** |
| [Day 40](./day40) | [Prefix, Infix, Postfix Conversion](./day40) | [http://codetoexpress.tech/dc/day40/](http://codetoexpress.tech/dc/day40/) | **Intermediate** |
| [Day 41](./day41) | [Implement Queue Data Structure](./day41) | [http://codetoexpress.tech/dc/day41/](http://codetoexpress.tech/dc/day41/) | **Beginner** |
| [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 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** |
| [Day 45](./day45) | [Priority Queue](./day45) | [http://codetoexpress.tech/dc/day45/](http://codetoexpress.tech/dc/day45/) | **Advanced** |
| [Day 46](./day46) | [Double Ended Queue](./day46) | [http://codetoexpress.tech/dc/day46/](http://codetoexpress.tech/dc/day46/) | **Advanced** |

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

Expand Down
2 changes: 1 addition & 1 deletion day41/README.md
Expand Up @@ -2,7 +2,7 @@

# Day 41 - Implement a Queue

Just like a stack, queue is also a linear data structure which follows a particular order in which the operations are performed. The order is called FIFO (First In First Out) which means the first element to enter the queue will be the last one to exit
Just like a stack, queue is also a linear data structure which follows a particular order in which the operations are performed. The order is called FIFO (First In First Out) which means the first element to enter the queue will be the first one to exit

There are many real-life examples of a queue, and the most common one of them is the real queue. It can be a queue of people waiting at billing counter, or a queue of people waiting at a ticket counter etc.

Expand Down
Binary file modified day41/ques.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added day44/carbon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added day45/ques.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions day46/JavaScript/deque.js
@@ -0,0 +1 @@
// To Be Added
37 changes: 37 additions & 0 deletions day46/README.md
@@ -0,0 +1,37 @@
![cover](./cover.png)

# Day 46 - Implement a double ended queue (deque)

Write a program to implement deque (Double Ended Queue)

### Double Ended Queue

Deque or Double Ended Queue is a generalized version of Queue data structure that allows insert and delete at both ends.

### Operations on Deque

Mainly the following four basic operations are performed on queue:

- insertFront(): Adds an item at the front of Deque.
- insertLast(): Adds an item at the rear of Deque.
- deleteFront(): Deletes an item from front of Deque.
- deleteLast(): Deletes an item from rear of Deque.

In addition to above operations, following operations are also supported

- getFront(): Gets the front item from queue.
- getRear(): Gets the last item from queue.
- isEmpty(): Checks whether Deque is empty or not.
- isFull(): Checks whether Deque is full or not.

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

## Solution

## JavaScript Implementation

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

```js
// To Be Added
```
Binary file added day46/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 cab1ced

Please sign in to comment.