자료구조

Queue Peek

hyunjin-dev-log 2021. 12. 28. 14:56



        public int Peek()
        {
            if (head == null)
            {
                throw new InvalidOperationException("큐가 비어있다.");
            }
            else
            {
                return head.data;
            }
        }