Skip to content

Commit 6e6f108

Browse files
Merge pull request amitshekhariitbhu#11 from josias1991/linked_list
Added LinkedList Explanation
2 parents bfd6e18 + 89125a3 commit 6e6f108

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@
2929
3030
* Array
3131
* LinkedList
32+
- A LinkedList, just like a tree and unlike an array, consists of a group of nodes which
33+
together represent a sequence. Each node contains data and a pointer. The data in a node can be
34+
anything, but the pointer is a reference to the next item in the LinkedList. A LinkedList
35+
contains both a head and a tail. The Head is the first item in the LinkedList, and the Tail is
36+
the last item. A LinkedList is not a circular data structure, so the tail does not have its
37+
pointer pointing at the Head, the pointer is just null. The run time complexity for each of
38+
the base methods are as follows:
39+
40+
41+
╔═══════════╦═════════╦════════════╗
42+
║ Algorithm ║ Average ║ Worst Case ║
43+
╠═══════════╬═════════╬════════════╣
44+
║ Space ║ O(n) ║ O(n) ║
45+
║ Search ║ O(n) ║ O(n) ║
46+
║ Insert ║ O(1) ║ O(1) ║
47+
║ Delete ║ O(1) ║ O(1) ║
48+
╚═══════════╩═════════╩════════════╝
49+
3250
* DoublyLinkedList
3351
* Stack
3452
* Queue

0 commit comments

Comments
 (0)