File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 29
29
30
30
* Array
31
31
* 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
+
32
50
* DoublyLinkedList
33
51
* Stack
34
52
* Queue
You can’t perform that action at this time.
0 commit comments