public E RemoveFirst() { SNode <E> temp = head; head = temp.Next; temp.Next = null; E tempElement = temp.Element; temp.Element = default; size--; return(tempElement); }
public void AddLast(E element) { SNode <E> newest = new SNode <E>(element, null); tail.Next = newest; tail = newest; if (IsEmpty()) { head = newest; } size++; }
public SList() { head = null; tail = null; }
public SNode(E element, SNode <E> next) { this.Element = element; this.Next = next; }