public T Pop() { if (_list.Count == 0) { throw new InvalidOperationException("Stack empty"); } T res = _list.Head.Data; _list.RemoveFirst(); return(res); }
public T Dequeue() { if (_itemsList.Count == 0) { throw new InvalidOperationException("queue empty"); } T res = _itemsList.Head.Data; _itemsList.RemoveFirst(); return(res); }