コード例 #1
0
        public T Pop()
        {
            if (linkList.Count == 0)
            {
                throw new InvalidOperationException("Stack is empty.");
            }

            return(linkList.RemoveFirst());
        }
コード例 #2
0
ファイル: Queue.cs プロジェクト: AdiThakker/ScratchPad
        public T Dequeue()
        {
            if (linkList.Count == 0)
            {
                throw new InvalidOperationException("Queue is empty.");
            }

            return(linkList.RemoveFirst());
        }