![](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..
![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/Fpjbb/btqC48HajzM/NHTqMJExNwWpZtGMYHVo61/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/rhLIg/btqC6lMNb6M/4niIiO5nkvxRnwJawY9vF1/img.jpg)
// Singly Linked List #include #include int in1, in2; //node 구조체정의 struct node { int data; struct node *next; }; struct node* head = 0; struct node* head2 = 0; //sLL에 추가하는함수 void addToSLL(int data) { struct node *cur; cur = (struct node*)malloc(sizeof(struct node)); cur->data = data; cur->next = 0; //1.SLL이 empty if (head == 0) { head = cur; return; } //2 else //2.1끝을찾자 //2.2끝에 붙이자 { struct node..
![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/bIlis1/btqC49szcx3/hnS8xBL02KjNtNLthFD5xK/img.jpg)
// Singly Linked List #include #include int in; //node 구조체정의 struct node { int data; struct node *next; }; struct node* head = 0; //sLL에 추가하는함수 void addToSLL(int data) { struct node *cur; cur = (struct node*)malloc(sizeof(struct node)); cur->data = data; cur->next = 0; //1.SLL이 empty if (head == 0) { head = cur; return; } //2 else //2.1끝을찾자 //2.2끝에 붙이자 { struct node* lastnode = head; while (last..
![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/EzfWc/btqC3q9FUz4/ZByITpcWRekzK1Zkvyn3WK/img.jpg)
// Singly Linked List #include #include int in; //node 구조체정의 struct node { int data; struct node *next; }; struct node* head = 0; //sLL에 추가하는함수 void addToSLL(int data) { struct node *cur; cur = (struct node*)malloc(sizeof(struct node)); cur->data = data; cur->next = 0; //1.SLL이 empty if (head == 0) { head = cur; return; } //2 else //2.1끝을찾자 //2.2끝에 붙이자 { struct node* lastnode = head; while (last..
![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/AMZfc/btqCWLF5Dco/fboKhbf53hwXDXA6Oim40k/img.jpg)
#include #include //node 구조체정의 struct node { int data; struct node *next; }; struct node* head = 0; //sLL에 추가하는함수 void addToSLL(int data) { struct node *cur; cur = (struct node*)malloc(sizeof(struct node)); cur->data = data; cur->next = 0; //1.SLL이 empty if (head == 0) { head = cur; return; } //2 else //2.1끝을찾자 //2.2끝에 붙이자 { struct node* lastnode = head; while (lastnode->next != 0) { lastnode = ..