public void Enumerate() { LinkedQueueElement <T> toPrint = this.Head; while (toPrint != null) { Console.Write(toPrint.value + " "); toPrint = toPrint.Next; } Console.WriteLine(); }
public void Enqueue(T value) { LinkedQueueElement <T> elemenToAdd = new LinkedQueueElement <T>() { value = value }; if (this.Head == null) { this.Head = elemenToAdd; this.Tail = elemenToAdd; } else { this.Tail.Next = elemenToAdd; elemenToAdd.Previous = this.Tail; this.Tail = elemenToAdd; } }