#include<iostream>
#include<stack>
using namespace std;
int main()
{
stack<int> s;
s.push(7);
s.push(5);
s.push(4);
s.pop();
s.push(6);
s.pop();
while (!s.empty())
{
cout << s.top() << ' ';
s.pop();
}
return 0;
}
'Algorithm > Basic_Algorithm' 카테고리의 다른 글
깊이 우선 탐색(DFS). (0) | 2020.02.08 |
---|---|
너비 우선 탐색(BFS). (0) | 2020.02.08 |
큐(Queue). (0) | 2020.02.08 |
계수정렬(Counting Sort). (0) | 2020.02.08 |
힙정렬(Heap Sort). (0) | 2020.02.08 |