public int Peek()
{
if (head == null)
{
throw new InvalidOperationException("큐가 비어있다.");
}
else
{
return head.data;
}
}
'자료구조' 카테고리의 다른 글
Queue 복습 (0) | 2021.12.28 |
---|---|
Queue Count (0) | 2021.12.28 |
Queue Dequeue (0) | 2021.12.28 |
Queue Enqueue (0) | 2021.12.28 |
스택 복습 (+ Push 순서도) (0) | 2021.12.28 |