Skip to content

Commit e99ac31

Browse files
committed
Add day 48
1 parent 6a3c06b commit e99ac31

File tree

7 files changed

+43
-1
lines changed

7 files changed

+43
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Motivate yourself to code daily till 60 days, and see the magic! Coding will bec
7575
| [Day 45](./day45) | [Priority Queue](./day45) | [http://codetoexpress.tech/dc/day45/](http://codetoexpress.tech/dc/day45/) | **Advanced** |
7676
| [Day 46](./day46) | [Double Ended Queue](./day46) | [http://codetoexpress.tech/dc/day46/](http://codetoexpress.tech/dc/day46/) | **Advanced** |
7777
| [Day 47](./day47) | [Singly Linked List](./day47) | [http://codetoexpress.tech/dc/day47/](http://codetoexpress.tech/dc/day47/) | **Intermediate** |
78+
| [Day 48](./day48) | [Doubly Linked List](./day48) | [http://codetoexpress.tech/dc/day48/](http://codetoexpress.tech/dc/day48/) | **Intermediate** |
7879

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

day46/carbon.png

1.27 MB
Loading

day47/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ A linked list is a linear data structure, in which the elements are not stored a
2222

2323
[Read More (Geeks4Geeks)](https://www.geeksforgeeks.org/linked-list-set-1-introduction/)
2424

25-
Try to implement a singly linked list
25+
Try to implement a singly linked list.
2626

2727
## Solution
2828

day47/carbon.png

1.03 MB
Loading

day48/JavaScript/dll.js

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

day48/README.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
![cover](./cover.png)
2+
3+
# Day 47 - Implement a doubly doubly linked list
4+
5+
Write a program to implement a doubly linked list
6+
7+
### Doubly Linked Lists
8+
9+
A doubly Linked List is a variation to a normal Linked List where, instead of one pointer pointing to the next node, there are 2 pointers, one pointing to the next node and the other one to the previous node.
10+
11+
![image](https://user-images.githubusercontent.com/26179770/53316858-6f783980-38ef-11e9-82f5-996aeb8bf08f.png)
12+
13+
Source: [Geeks4Geeks](https://www.geeksforgeeks.org/doubly-linked-list/)
14+
15+
### Advantages of Doubly Linked Lists
16+
17+
1. A DLL can be traversed in both forward and backward direction.
18+
2. The delete operation in DLL is more efficient if pointer to the node to be deleted is given.
19+
3. We can quickly insert a new node before a given node.
20+
21+
In singly linked list, to delete a node, pointer to the previous node is needed. To get this previous node, sometimes the list is traversed. In DLL, we can get the previous node using previous pointer.
22+
23+
### Disadvantages of Linked Lists
24+
25+
1. Every node of DLL Require extra space for an previous pointer. It is possible to implement DLL with single pointer though (See this and this).
26+
2. All operations require an extra pointer previous to be maintained. For example, in insertion, we need to modify previous pointers together with next pointers. For example in following functions for insertions at different positions, we need 1 or 2 extra steps to set previous pointer.
27+
28+
[Read More (Geeks4Geeks)](https://www.geeksforgeeks.org/doubly-linked-list/)
29+
30+
Try to implement a doubly linked list.
31+
32+
## Solution
33+
34+
## JavaScript Implementation
35+
36+
### [Solution](./JavaScript/dll.js)
37+
38+
```js
39+
// To Be Added
40+
```

day48/cover.png

137 KB
Loading

0 commit comments

Comments
 (0)