Example #1
0
 public int Pull()
 {
     if (head == null)
         throw new NullReferenceException("head in null");
     QueueElem tmp = head;
     head = head.Next;
     tmp.Next = null;
     return tmp.Date;
 }
Example #2
0
        public void Add(int date)
        {
            QueueElem newElem = new QueueElem();
            newElem.Date = date;

            if (end == null)
                head = end = newElem;
            else
            {
                end.Next = newElem;
                end = newElem;
            }
        }