A singly linked list node
Each node wraps an element and stores a reference to the next list node.
SllNode objects are created and managed by the Sll class.
SllNode
Sll
new (val:T, list:Sll<T>)
Parameters:
val
the element to store in this node.
list
the list storing this node.
next:SllNode<T>
The next node in the list being referenced or null if this node has no next node.
val:T
The node's data.
free ():Void
Destroys this object by explicitly nullifying all pointers and elements for GC'ing used resources.
Improves GC efficiency/performance (optional).
toString ():String
Prints out all elements.