Skip to content

Commit

Permalink
Fixes Asiatik#326 - Added documentation for linked lists (Asiatik#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
itchylol742 authored and jigyasak05 committed Oct 16, 2018
1 parent ec5114f commit eaace6c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions Data Structures/Linked Lists/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Linked list

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.

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.

Images from Wikipedia under public domain.

# Singly linked list diagram:
![alt text](Singly-linked-list.png)
# Doubly linked list diagram:
![alt text](Doubly-linked-list.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit eaace6c

Please sign in to comment.