Esempio n. 1
0
        public E RemoveFirst()
        {
            SNode <E> temp = head;

            head      = temp.Next;
            temp.Next = null;
            E tempElement = temp.Element;

            temp.Element = default;
            size--;
            return(tempElement);
        }
Esempio n. 2
0
        public void AddLast(E element)
        {
            SNode <E> newest = new SNode <E>(element, null);

            tail.Next = newest;
            tail      = newest;
            if (IsEmpty())
            {
                head = newest;
            }
            size++;
        }
Esempio n. 3
0
 public SList()
 {
     head = null;
     tail = null;
 }
Esempio n. 4
0
 public SNode(E element, SNode <E> next)
 {
     this.Element = element;
     this.Next    = next;
 }