Skip to content

Commit cab1ced

Browse files
committed
Add day 46 - deque
1 parent 7919061 commit cab1ced

File tree

8 files changed

+43
-4
lines changed

8 files changed

+43
-4
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ Motivate yourself to code daily till 60 days, and see the magic! Coding will bec
6969
| [Day 39](./day39) | [Maximum Element and Reverse Stack](./day39) | [http://codetoexpress.tech/dc/day39/](http://codetoexpress.tech/dc/day39/) | **Intermediate** |
7070
| [Day 40](./day40) | [Prefix, Infix, Postfix Conversion](./day40) | [http://codetoexpress.tech/dc/day40/](http://codetoexpress.tech/dc/day40/) | **Intermediate** |
7171
| [Day 41](./day41) | [Implement Queue Data Structure](./day41) | [http://codetoexpress.tech/dc/day41/](http://codetoexpress.tech/dc/day41/) | **Beginner** |
72-
| [Day 42](./day42) | [Alternate Queue Combination](./day42) | [http://codetoexpress.tech/dc/day42/](http://codetoexpress.tech/dc/day42/) | **intermediate** |
73-
| [Day 43](./day43) | [Queue Reversal](./day43) | [http://codetoexpress.tech/dc/day43/](http://codetoexpress.tech/dc/day43/) | **intermediate** |
72+
| [Day 42](./day42) | [Alternate Queue Combination](./day42) | [http://codetoexpress.tech/dc/day42/](http://codetoexpress.tech/dc/day42/) | **Intermediate** |
73+
| [Day 43](./day43) | [Queue Reversal](./day43) | [http://codetoexpress.tech/dc/day43/](http://codetoexpress.tech/dc/day43/) | **Intermediate** |
7474
| [Day 44](./day44) | [Queue from Stacks](./day44) | [http://codetoexpress.tech/dc/day44/](http://codetoexpress.tech/dc/day44/) | **intermediate** |
75-
| [Day 45](./day45) | [Priority Queue](./day45) | [http://codetoexpress.tech/dc/day45/](http://codetoexpress.tech/dc/day45/) | **intermediate** |
75+
| [Day 45](./day45) | [Priority Queue](./day45) | [http://codetoexpress.tech/dc/day45/](http://codetoexpress.tech/dc/day45/) | **Advanced** |
76+
| [Day 46](./day46) | [Double Ended Queue](./day46) | [http://codetoexpress.tech/dc/day46/](http://codetoexpress.tech/dc/day46/) | **Advanced** |
7677

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

day41/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Day 41 - Implement a Queue
44

5-
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
5+
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
66

77
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.
88

day41/ques.png

-39.9 KB
Loading

day44/carbon.png

722 KB
Loading

day45/ques.png

1020 KB
Loading

day46/JavaScript/deque.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// To Be Added

day46/README.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
![cover](./cover.png)
2+
3+
# Day 46 - Implement a double ended queue (deque)
4+
5+
Write a program to implement deque (Double Ended Queue)
6+
7+
### Double Ended Queue
8+
9+
Deque or Double Ended Queue is a generalized version of Queue data structure that allows insert and delete at both ends.
10+
11+
### Operations on Deque
12+
13+
Mainly the following four basic operations are performed on queue:
14+
15+
- insertFront(): Adds an item at the front of Deque.
16+
- insertLast(): Adds an item at the rear of Deque.
17+
- deleteFront(): Deletes an item from front of Deque.
18+
- deleteLast(): Deletes an item from rear of Deque.
19+
20+
In addition to above operations, following operations are also supported
21+
22+
- getFront(): Gets the front item from queue.
23+
- getRear(): Gets the last item from queue.
24+
- isEmpty(): Checks whether Deque is empty or not.
25+
- isFull(): Checks whether Deque is full or not.
26+
27+
[Read More (Geeks4Geeks)](https://www.geeksforgeeks.org/deque-set-1-introduction-applications/)
28+
29+
## Solution
30+
31+
## JavaScript Implementation
32+
33+
### [Solution](./JavaScript/deque.js)
34+
35+
```js
36+
// To Be Added
37+
```

day46/cover.png

142 KB
Loading

0 commit comments

Comments
 (0)