/*
#include <stdio.h>
#include <string.h>
int stack[201]={};
int top=-1;
void push(int n)
{
stack[++top]=n;
}
pop(char n)
{
if(n=='+'){
stack[top-1]=stack[top]+stack[top-1];
}
else if(n=='-')
stack[top-1]=stack[top-1]-stack[top];
else stack[top-1]=stack[top]*stack[top-1];
top--;
}
int main()
{
int i,j,l,num=0,cnt=0;
char scan[201]={};
gets(scan);
for(i=0;scan[i]!=0;i++){
if('0'<=scan[i]&& scan[i]<='9'){
num=num*10+scan[i]-'0';
if(scan[i+1]==' ') {
push(num);
num=0;
}
}
else if(scan[i]!=' '){
pop(scan[i]);
}
}
printf("%d",stack[top]);
return 0;
}
stack lifo
top
queue fifo
front : 마지막으로 나간 데이터의 위치
rear : 마지막으로 들어온 데이터의 위치 (==top)
enqueue (push)
dequeue (pop)
#include <stdio.h>
int queue[500];
int front=-1;
int rear=-1;
void enq(int data)
{
queue[++rear]=data;
}
int deq()
{
if(front==rear) return -1; //empty check
return queue[++front];
}
int main()
{
return 0;
}
dfs - recursive or stack
bfs - queue
현재의 최적 해가 전체의 최적 해
*/
#include <stdio.h>
#include <string.h>
int top=-1;
int main()
{
}