Singly Linked List
- implement new data-sahpe and manipulate it.
BIG O_____
-
time(insert) –> O(1)
-
space(insert) –> O(1)
-
time(includes & to_string methods ) –> O(n)
-
space(includes & to_string methods ) –> O(n)
Testing
- Can successfully instantiate an empty linked list.
- The head property will properly point to the first node in the linked list.
- Can properly insert into the linked list.
- Can properly insert multiple nodes into the linked list.
- Will return true when finding a value within the linked list that exists.
- Will return false when searching for a value in the linked list that does not exist.
- Can properly return a collection of all the values that exist in the linked list.
-
LinkedList.insert()
Adds a new node with that value to the head of the list. -
LinkedList.includes()
Indicates whether that value exists as a Node’s value somewhere within the list. -
LinkedList.to_string()
Returns a formatted string representing all the values in the Linked List.