Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #326 - Added documentation for linked lists #327

Merged
merged 8 commits into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.