Beispiel #1
0
        public T Peek()
        {
            if (Count == 0)
            {
                throw new Exception("No item to dequeue.");
            }
            T item = UnderlyingList.First();

            return(item);
        }
Beispiel #2
0
        public T Dequeue()
        {
            if (!UnderlyingList.Any())
            {
                throw new Exception("Nothing to dequeue.");
            }
            T item = UnderlyingList.First();

            UnderlyingList.RemoveAtIndex(0);
            return(item);
        }