Go Linked List
Generating a basic Linked List.
Creates a node with data and a link.
Functions for the list include:
- insertFirst: Insert at the head of list
- getFirst: Fetch the first node
- getLast: Fetch the last node
- clear: Remove all node
- removeFirst: Remove head of list
- removeLast: Remove last node
- insertLast: Insert at end of list
- getAt: Fetch node at index
- removeAt: Remove node at index
- insertAt: Insert at index
- forEach: Iterate through list and run function on list
insertFirst
Tips:
- Create a list that had a head, size and lock property
- Create a node that holds some form of data and has another property pointing to another node
getFirst
Return a pointer to the first node.