You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/content/part02/linked-list.asc
+22-1Lines changed: 22 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,28 @@ endif::[]
9
9
[[linked-list]]
10
10
=== Linked List
11
11
12
-
A list (or Linked List) is a linear data structure where each object has a pointer to the next one.
12
+
A list (or Linked List) is a linear data structure where each object has a pointer to the next one creating a chain. You can also have a back reference to the previous node.
13
+
14
+
image::dllx4-compact.png[]
15
+
16
+
The data doesn't have to be a number. It can be anything that you need (e.g., images, songs, menu items).
17
+
18
+
.Some features powered by linked lists:
19
+
- _Image viewer_ – The previous and next images are linked in an image viewer so that the user can navigate them.
20
+
- _Previous and next page in web browser_ – We can access the previous and next URL searched in a web browser by pressing the back and next button since they are linked.
21
+
- _Music Player_ - Queue of songs in a music player connects them so you can move to the next song or previous one.
22
+
23
+
.Other Applications:
24
+
- Build <<Stack>> and <<Queue>> data structures, which are useful for Graph Traversal and other things.
25
+
- Linked Lists are used on <<hashmap-chap>> to handle collisions.
26
+
- Linked Lists can be used when representing a <<graph>> as an adjacency list.
27
+
- Operate arbitrary big numbers (think hundreds of digits). Each digit is a node of a linked list.
28
+
- Manipulation of polynomials by storing constants in the node of a linked list.
29
+
- Representing sparse matrices (an array representation will waste a lot of memory when most of the cells are empty). The linked list will represent only the non-zero values saving significant space.
30
+
31
+
Hopefully, this will get you excited about learning Linked Lists since it's the base of many interesting applications. Let's learn more about the different types of linked lists.
0 commit comments