Fully complete Linked list library. This is a Go port of a C library - lists.
ListInit should be called before any operation can be used on with the linked list
l := LinkedListInit(data)
ListDestroy destroys the linked list. No operations are permitted to be called on the linked list after ListDestroy is called
err = LinkedListDestroy(l.LinkedList)
InsertNext inserts a node after the current linked list element. If the element is nil then the new element gets placed at the head of the list & then return the tail.
err, tailNode := l.LinkedList.InsertNext(l.tailNode, data)
RemoveNext removes the next element after node & returns an error if one exists & the removed node's data. If the node is nil then the head of the list is removed & the head's data returned.
err, node := l.LinkedList.RemoveNext(nil)
ListSize returns the total number of nodes in the list.
size := l.LinkedList.ListSize()
ListHead returns the head of the list
head := l.LinkedList.ListHead()
ListTail returns the tail node of the list.
tail := l.Tail()
IsHead determines if element is the head of the list.
isHead := l.IsHead(node)
IsTail determines if element is the tail of the list.
isTail := l.IsTail(node)
Evaluate returns the data of element's Node
err, result = l.Evaluate(node)
NextNode returns the next Node in the list.
err, nextNode := l.NextNode(node)