![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/dH6EYe/btqC78gXhfK/fhqS1tl22gUY5nor3shH30/img.jpg)
#include #include #define SZ 7 int queue[SZ]; int front = 0; int rear = 0; int isEmpty() { return (rear == front); } int isFull() { return ((rear + 1) % SZ == front); } int deque() { if (isEmpty() == 1) { return -999; } int temp = queue[front]; front = (front + 1) % SZ; return temp; } void enque(int n) { int if100 = 0; if (isFull() == 1) { return; } if (n == 100) { while (isEmpty() == 0) { if100..
![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/bCGkDc/btqC9xtBNTu/Dk3F6y2J4NwcKd6xVWzJw0/img.jpg)
#include #include #define SZ 100 int stack[SZ]; int top = -1; int isEmpty() { return (top == -1); } int isFull() { return (top == (SZ - 1)); } int pop() { if (isEmpty() == 1) { return -999; } int temp; temp = stack[top--]; return temp; } void push(int n) { int if100 = 0; int popped = 0; if (isFull() == 1) { return; } if (n == 100) { while (isEmpty() == 0) { popped = pop(); if100 = if100 + popped..
![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/bWe3ON/btqC7889zJv/9OrBKpj9tbzBkNFpuzKC30/img.jpg)
#include #include #define SZ 5 int queue[SZ]; int front = 0; int rear = 0; int isEmpty() { return (rear == front); } int isFull() { return ((rear + 1) % SZ == front); } void enque(int n) { if (isFull() == 1) { return; } queue[rear] = n; rear = (rear + 1) % SZ; return; } int deque() { if (isEmpty() == 1) { return -999; } int temp = queue[front]; front = (front + 1) % SZ; return temp; } int main(v..
![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/Jx5d6/btqDbkz3EVE/kelJn0vkyDvr03hX8ICL8k/img.jpg)
#include #include #define SZ 5 int stack[SZ]; int top = -1; int isEmpty() { return (top == -1); } int isFull() { return (top == (SZ - 1)); } void push(int n) { if (isFull() == 1) { return; } stack[++top] = n; return; } int pop() { if (isEmpty() == 1) { return -999; } int temp; temp = stack[top--]; return temp; } int main(void) { int n, data; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("..
![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/bt7hsO/btqDbmEGMwr/QyhY17Uun66bbDbNUuGQyk/img.jpg)
#include #include //node 구조체정의 struct node { int data; struct node *next; struct node *prev; }; struct node* head = 0; struct statNode{ int data; int freq; struct statNode *prev; struct statNode *next; }; struct statNode *shead = 0; //returns the pointer to the node which has bigger data than _data //returns null if _data is the biggest struct statNode *whoIsBigger(int _data) { struct statNode *..
![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/cJCrn1/btqC85xicDn/Owb7Vm7KlaACpP0WRKqiJ1/img.jpg)
#include #include struct node { int data; struct node *next; struct node *prev; }; struct node* head = 0; void addToDLL(int n) { struct node* cur; cur = (struct node*)malloc(sizeof(struct node)); cur->data = n; cur->next = 0; cur->prev = 0; if (head == 0) { head = cur; return; } { //끝을 찾는다 struct node* temp = head; while (temp->next != 0) { temp = temp->next; } temp->next = cur; cur->prev = temp..
![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/UFOsC/btqC9xApxkl/JfMoMXmf3Myu8vIusWB4L1/img.jpg)
#include #include struct node { int data; struct node *next; struct node *prev; }; struct node* head = 0; void addToDLL(int n) { struct node* cur; cur = (struct node*)malloc(sizeof(struct node)); cur->data = n; cur->next = 0; cur->prev = 0; if (head == 0) { head = cur; return; } { //끝을 찾는다 struct node* temp = head; while (temp->next != 0) { temp = temp->next; } temp->next = cur; cur->prev = temp..
![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/bBYJSn/btqC49TChVB/jFepHj7U10rRKRsUBkKNA1/img.jpg)
#include #include struct node { int data; struct node *next; struct node *prev; }; struct node* head = 0; void addToDLL(int n) { struct node* cur; cur = (struct node*)malloc(sizeof(struct node)); cur->data = n; cur->next = 0; cur->prev = 0; if (head == 0) { head = cur; return; } { //끝을 찾는다 struct node* temp = head; while (temp->next != 0) { temp = temp->next; } temp->next = cur; cur->prev = temp..