Esempio n. 1
0
        public void Enqueue(LinkedQueueNode <T> element)
        {
            if (this.FirstElement == null)
            {
                this.FirstElement = element;
            }
            else
            {
                if (this.FirstElement.NextInLine == null)
                {
                    this.FirstElement.NextInLine = element;
                    element.PrevInLine           = this.FirstElement;
                }
                else
                {
                    this.LastElement.NextInLine = element;
                    element.PrevInLine          = this.LastElement;
                }

                this.LastElement = element;
            }

            this.Count++;
        }
Esempio n. 2
0
 public LinkedQueueNode(T value, LinkedQueueNode <T> nextListItem, LinkedQueueNode <T> prevListItem)
 {
     this.Value      = value;
     this.NextInLine = nextListItem;
     this.PrevInLine = prevListItem;
 }