public T Pop() { if (linkList.Count == 0) { throw new InvalidOperationException("Stack is empty."); } return(linkList.RemoveFirst()); }
public T Dequeue() { if (linkList.Count == 0) { throw new InvalidOperationException("Queue is empty."); } return(linkList.RemoveFirst()); }