ALGORITHM/코딩테스트를 위한 자료구조와 알고리즘 with c++ 정리

std::queue

JC0 2021. 12. 20. 23:41

큐는 first in - first out 구조를 가지고 있다. 식당이나 놀이공원에서 줄을 먼저 선 순서대로 나가는 것이라고 생각해보자.

#include <iostream>
#include <queue>

int main()
{
	std::queue<int> q;
	q.push(1);
	q.push(2);
	q.push(3);
	q.pop();
	q.push(4);

}

 

저작자표시 (새창열림)