Queue 클래스는 FIFO(First In First Out) 특성을 보이는데, 나중에 들어온 데이터가 나중에 출력되는 자료구조이다.
Enqueue() | 큐에 데이터를 저장함 |
---|---|
Dequeue() | 큐에서 데이터를 출력함 |
System.Colletions.Generic
네임스페이스를 포함해야합니다.using System.Collections.Generic;
Queue<T>
형태인 Queue<T>
으로 문자열만 다룰 수 있는 Queue 클래스를 만듭니다.Queue<string> queue = new Queue<string>();