public T Pop() { if (_head == null) { return(default(T)); } var returnValue = _head.value; _head = _head.next; return(returnValue); }
IEnumerator <T> GetEnumerator() { var tail = _tail; if (tail != null) { do { yield return(tail.value); _tail = tail.next; }while(tail != null); } }
public void Push(T element) { KolejkaNode <T> node = new KolejkaNode <T> (); node.value = element; node.next = null; if (_head != null) { _tail.next = node; } else { _head = node; } _tail.next = node; _tail = node; }