#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 *..
#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..
#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..
#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..
#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..