Skip to content

Commit a9eeea2

Browse files
committed
Update doubly linked list README.
1 parent 6b354ad commit a9eeea2

File tree

1 file changed

+17
-2
lines changed
  • src/data-structures/doubly-linked-list

1 file changed

+17
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
# Doubly Linked List
22

3-
In computer science, a doubly linked list is a linked data structure that consists of a set of sequentially linked records called nodes. Each node contains two fields, called links, that are references to the previous and to the next node in the sequence of nodes. The beginning and ending nodes' previous and next links, respectively, point to some kind of terminator, typically a sentinel node or null, to facilitate traversal of the list. If there is only one sentinel node, then the list is circularly linked via the sentinel node. It can be conceptualized as two singly linked lists formed from the same data items, but in opposite sequential orders.
3+
In computer science, a **doubly linked list** is a linked data structure that
4+
consists of a set of sequentially linked records called nodes. Each node contains
5+
two fields, called links, that are references to the previous and to the next
6+
node in the sequence of nodes. The beginning and ending nodes' previous and next
7+
links, respectively, point to some kind of terminator, typically a sentinel
8+
node or null, to facilitate traversal of the list. If there is only one
9+
sentinel node, then the list is circularly linked via the sentinel node. It can
10+
be conceptualized as two singly linked lists formed from the same data items,
11+
but in opposite sequential orders.
412

513
![Doubly Linked List](https://upload.wikimedia.org/wikipedia/commons/5/5e/Doubly-linked-list.svg)
614

15+
The two node links allow traversal of the list in either direction. While adding
16+
or removing a node in a doubly linked list requires changing more links than the
17+
same operations on a singly linked list, the operations are simpler and
18+
potentially more efficient (for nodes other than first nodes) because there
19+
is no need to keep track of the previous node during traversal or no need
20+
to traverse the list to find the previous node, so that its link can be modified.
21+
722
## References
823

924
- [Wikipedia](https://en.wikipedia.org/wiki/Doubly_linked_list)
10-
- [YouTube](https://www.youtube.com/watch?v=JdQeNxWCguQ)
25+
- [YouTube](https://www.youtube.com/watch?v=JdQeNxWCguQ&t=7s&index=72&list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8)

0 commit comments

Comments
 (0)