Skip to content

Commit 7b47ad0

Browse files
itchylol742tstreamDOTh
authored andcommitted
Fixes #326 - Added documentation for linked lists (#327)
1 parent e7f398e commit 7b47ad0

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Linked list
2+
3+
A linked list is a collection of nodes which are connected to each other by pointers. A singly linked list has a pointer to the first node, and each node has a pointer to the next node. A double linked list has a pointer to the first and last node, and each node has a pointer to the next and previous node. Each node also contains data.
4+
5+
Linked lists have a runtime of O(1) when inserting or reading data from the front of the list (and back for doubly linked lists), but have a runtime of O(n) when accessing a specific element in the list or searching the list.
6+
7+
Images from Wikipedia under public domain.
8+
9+
# Singly linked list diagram:
10+
![alt text](Singly-linked-list.png)
11+
# Doubly linked list diagram:
12+
![alt text](Doubly-linked-list.png)
Loading

0 commit comments

Comments
 (0)