Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Code Smart, Don't Code hard

Ff7d47a899d7cde4dd379677e2f06021?s=47 crboy
March 30, 2012
10k

Code Smart, Don't Code hard

Ff7d47a899d7cde4dd379677e2f06021?s=128

crboy

March 30, 2012
Tweet

Transcript

  1. ᄳ೻όkԟԬϼࢪӚ઺ٙԫ Code Smart, Don’t Code Hard  !਷ͭϓ̌ɽኪ༟ʈӻ᎜ ଭ͗ݰ ʃଭ$S#PZ

    DSCPZ!DSCPZOFU Release
  2. ίක֐ʘۃ... й׊lεਪਪᕚl ʦ˂̥ਂ୑૵ᔊʧdШܘᛇڎଉɝীሞl ν؈̈ତи३༑...ࠅ३l ʕගʔ;ࢹdІ͟ආ̈ɪఽהᑺ˓ዚאွᙂ Шν؈ܘଢ଼ٙ༑...ఱᒔ݊;ࢹɓɨXD εਪਪᕚl й׊l

  3. Ңࡁ˸ۃேܣჿᄳ೻όٙk

  4. None
  5. None
  6. None
  7. None
  8. None
  9. None
  10. None
  11. ??

  12. None
  13. None
  14. ԟ%&#6(ճk

  15. pr i ntf ˮ೐ l Ңᙼޒɧࡈᜊᅰd̜ఎprintfl

  16. None
  17. None
  18. None
  19. None
  20. None
  21. None
  22. None
  23. ಻༊ৃࢹΙ˄εk

  24. None
  25. None
  26. None
  27. None
  28. None
  29. None
  30. Ҫprintfᔷϓൗ༆ً࿒dഐҼவΫΥl

  31. ೻όᒔ݊׉׉ٙ

  32. pr i ntf ˮ ೐ Ύ ତ l ࣅદ೻όᇁٙൗ༆d̜ఎprintfl

  33. None
  34. None
  35. None
  36. Ыॆٙܘрɢ Ꮀ

  37. ҢϞࣛࡉܘฌ͜ XDrz debug ج printf("XD"); /* do many things */

    printf("rz\n"); ν؈ӚԒ᜗ఱ݊ݔࡈή˙ᖑદəXD XD ɰ݊ɓם
  38. ϼࢪj˜рɢ݊ึϞΫజٙl εᄳɓࡈ̌ঐ̋ʱ™

  39. Ыɦක֐рɢ

  40. /*¶®•\§jæ«∏Í∞T§uµ{æ«®t98Ø≈§AØZ≤¶•…¨u æ«∏π°GF74942294*/ / ****************************************************************************** * FileName: hw7_s.c Programmer: CrBoy Purpose:

    ≥–≥y§@≠”singly linked list®√∞ı¶Ê¶U∫ÿ•\؇ Input: Output: the standard out Compilation: gcc hw7_s.c -o hw7_s Run: ./hw7_s Date: 2006/1/8 / ****************************************************************************** / #include <stdio.h> struct node{ * int data; * struct node *next; }; typedef struct node node; void print_list(node*);/*print_list(h); ¶C¶L•Hh∂}¿Y™∫linked list*/ node *Insert(int, node*);/*Insert(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥ °§Jdata®√¶^∂«∑s™∫h*/ node *Delete(int, node*);/*Delete(data, h); ¶b•Hh∂}¿Y™∫linked list§§ßR∞ £data®√¶^∂«∑s™∫h*/ node *Search(int, node*);/*Search(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥Mß ‰data®√∂«¶^data©“¶b™∫¶Ï∏m*/ int Count(node*);/*Count(h); ≠p∫‚•Hh∂}¿Y™∫linked list§§™∫∏`¬I≠”º∆*/ node *Reverse(node*);/*Reverse(h); §œß«±∆¶C•Hh∂}¿Y™∫linked list®√∂«¶^∑s™∫h*/ node *Merge(node*, node*);/*Merge(h1, h2); ¶X®÷h1ªPh2≥o2≠”linked list®√¶^∂«¶X®÷´·™∫™∫head*/ void Split(node**, node**, node**);/*Split(&h, &h1, &h2); §¿≥Œh≥o≠”linked list¨∞©_∞∏º∆®√§¿ßO¶s®Ïh1ªPh2§§*/ void help(); int order=1; int main(void){ * int sel=8, data=0; * node *h=NULL, *h1=NULL, *h2=NULL; * help(); * while(sel){ * * printf("\n•ÿ´e™∫Linked list°G"); * * print_list(h); * * printf("Ω–øÔæ‹•\\؇°G"); * * if(scanf("%d", &sel)==0){ * * * sel=-1; * * * fflush(stdin); * * } * * switch(sel){ * * * case 0: break; * * * case 1: * * * * printf("Ω–øȧJ±˝¥°§J™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * if(order) * * * * * h = Insert(data, h); * * * * else{ * * * * * h = Reverse(h); * * * * * h = Insert(data, h); * * * * * h = Reverse(h); * * * * } * * * * break; * * * case 2: * * * * printf("Ω–øȧJ±˝ßR∞£™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * if(order) * * * * * h = Delete(data, h); * * * * else{ * * * * * h = Reverse(h); * * * * * h = Delete(data, h); * * * * * h = Reverse(h); * * * * } * * * * break; * * * case 3: * * * * printf("Ω–øȧJ±˝∑j¥M™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * h1 = Search(data, h); * * * * printf("•H%dß@¨∞∞_¬I™∫Linked list°G", data); * * * * print_list(h1); * * * * h1 = NULL; * * * * break; * * * case 4: * * * * printf("•ÿ´e™∫Linked list¶@¶≥%d≠”node °C\n", Count(h)); * * * * break; * * * case 5: * * * * h = Reverse(h); * * * * break; * * * case 6: * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * h = Merge(h1, h2); * * * * h1 = h2 = NULL; * * * * break; * * * case 7: * * * * if(order) Split(&h, &h1, &h2); * * * * else{ * * * * * h = Reverse(h); * * * * * Split(&h, &h1, &h2); * * * * } * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * break; * * * default: printf("±z™∫øȧJ¶≥ª~°I\n"); * * * case 8: help(); * * } * } * return 0; } void print_list(node *h){ * node *temp; * temp = h; * while(temp != NULL){ * * printf("%d -> ", temp->data); * * temp = temp->next; * } * printf("NULL\n"); } node *Insert(int data, node *h){ * node *p, *t, *temp; * if(h==NULL){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = NULL; * * return temp; * } * p = h; * t = h->next; * if(data<p->data){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = p; * * return temp; * } * if(t!=NULL) * * while(data<p->data || data>t->data){ * * * p = p->next; * * * t = t->next; * * * if(t==NULL) break; * * } * temp = (node*)malloc(sizeof(node)); * temp->data = data; * temp->next = p->next; * p->next = temp; * return h; } node *Delete(int data, node *h){ * node *p, *t; * if(h==NULL) return h; * p = h; * t = h->next; * if(data == p->data){ * * p = p->next; * * free(h); * * return p; * } * while(data!=t->data){ * * p = p->next; * * t = t->next; * * if(t==NULL) return h; * } * p->next = t->next; * free(t); * return h; } node *Search(int data, node *h){ * node *p=h; * while(p!=NULL && data!=p->data)* p = p->next; * return p; } int Count(node *h){ * int count=0; * while(h!=NULL){ * * count += 1; * * h = h->next; * } * return count; } node *Reverse(node *h){ * node *a, *b, *c; * if(h==NULL || h->next==NULL) return h; * a = h; * b = a->next; * c = b->next; * a->next = NULL; * while(c!=NULL){ * * b->next = a; * * a = b; * * b = c; * * c = c->next; * } * b->next = a; * order = !order; * return b; } node *Merge(node *h1, node *h2){ * node *h, *temp; * h = temp = h1->data < h2->data ? h1 : h2; * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * while(h1!=NULL && h2!=NULL){ * * temp = temp->next = h1->data < h2->data ? h1 : h2; * * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * } * h2 == NULL ? (temp->next=h1) : (temp->next=h2); * return h; } void Split(node **h, node **h1_ptr, node **h2_ptr){ * node *h1=NULL, *h2=NULL; * while(*h!=NULL){ * * if((*h)->data%2){ * * * if(h1==NULL) h1 = *h1_ptr = *h; * * * else *h1_ptr = (*h1_ptr)->next = *h; * * }else{ * * * if(h2==NULL) h2 = *h2_ptr = *h; * * * else *h2_ptr = (*h2_ptr)->next = *h; * * } * * *h = (*h)->next; * } * (*h1_ptr)->next = (*h2_ptr)->next = NULL; * *h1_ptr = h1; * *h2_ptr = h2; * *h = NULL; } void help(){ * printf("0.µ≤ßÙ\n"); * printf("1.Insert\n"); * printf("2.Delete\n"); * printf("3.Search\n"); * printf("4.Count\n"); * printf("5.Reverse\n"); * printf("6.Merge\n"); * printf("7.Split\n"); * printf("8.help\n"); }
  41. /*¶®•\§jæ«∏Í∞T§uµ{æ«®t98Ø≈§AØZ≤¶•…¨u æ«∏π°GF74942294*/ / ****************************************************************************** * FileName: hw7_s.c Programmer: CrBoy Purpose:

    ≥–≥y§@≠”singly linked list®√∞ı¶Ê¶U∫ÿ•\؇ Input: Output: the standard out Compilation: gcc hw7_s.c -o hw7_s Run: ./hw7_s Date: 2006/1/8 / ****************************************************************************** / #include <stdio.h> struct node{ * int data; * struct node *next; }; typedef struct node node; void print_list(node*);/*print_list(h); ¶C¶L•Hh∂}¿Y™∫linked list*/ node *Insert(int, node*);/*Insert(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥ °§Jdata®√¶^∂«∑s™∫h*/ node *Delete(int, node*);/*Delete(data, h); ¶b•Hh∂}¿Y™∫linked list§§ßR∞ £data®√¶^∂«∑s™∫h*/ node *Search(int, node*);/*Search(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥Mß ‰data®√∂«¶^data©“¶b™∫¶Ï∏m*/ int Count(node*);/*Count(h); ≠p∫‚•Hh∂}¿Y™∫linked list§§™∫∏`¬I≠”º∆*/ node *Reverse(node*);/*Reverse(h); §œß«±∆¶C•Hh∂}¿Y™∫linked list®√∂«¶^∑s™∫h*/ node *Merge(node*, node*);/*Merge(h1, h2); ¶X®÷h1ªPh2≥o2≠”linked list®√¶^∂«¶X®÷´·™∫™∫head*/ void Split(node**, node**, node**);/*Split(&h, &h1, &h2); §¿≥Œh≥o≠”linked list¨∞©_∞∏º∆®√§¿ßO¶s®Ïh1ªPh2§§*/ void help(); int order=1; int main(void){ ! node *h1=NULL, *h2=NULL; ! while(*h!=NULL){ ! ! if((*h)->data%2){ ! ! ! if(h1==NULL) h1 = *h1_ptr = *h; ! ! ! else *h1_ptr = (*h1_ptr)->next = *h; ! ! }else{ ! ! ! if(h2==NULL) h2 = *h2_ptr = *h; ! ! ! else *h2_ptr = (*h2_ptr)->next = *h; ! ! } ! ! *h = (*h)->next; ! } ! (*h1_ptr)->next = (*h2_ptr)->next = NULL; ! *h1_ptr = h1; ! *h2_ptr = h2; ! *h = NULL; * int sel=8, data=0; * node *h=NULL, *h1=NULL, *h2=NULL; * help(); * while(sel){ * * printf("\n•ÿ´e™∫Linked list°G"); * * print_list(h); * * printf("Ω–øÔæ‹•\\؇°G"); * * if(scanf("%d", &sel)==0){ * * * sel=-1; * * * fflush(stdin); * * } * * switch(sel){ * * * case 0: break; * * * case 1: * * * * printf("Ω–øȧJ±˝¥°§J™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * if(order) * * * * * h = Insert(data, h); * * * * else{ * * * * * h = Reverse(h); * * * * * h = Insert(data, h); * * * * * h = Reverse(h); * * * * } * * * * break; * * * case 2: * * * * printf("Ω–øȧJ±˝ßR∞£™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * if(order) * * * * * h = Delete(data, h); * * * * else{ * * * * * h = Reverse(h); * * * * * h = Delete(data, h); * * * * * h = Reverse(h); * * * * } * * * * break; * * * case 3: * * * * printf("Ω–øȧJ±˝∑j¥M™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * h1 = Search(data, h); * * * * printf("•H%dß@¨∞∞_¬I™∫Linked list°G", data); * * * * print_list(h1); * * * * h1 = NULL; * * * * break; * * * case 4: * * * * printf("•ÿ´e™∫Linked list¶@¶≥%d≠”node °C\n", Count(h)); * * * * break; * * * case 5: * * * * h = Reverse(h); * * * * break; * * * case 6: * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * h = Merge(h1, h2); * * * * h1 = h2 = NULL; * * * * break; * * * case 7: * * * * if(order) Split(&h, &h1, &h2); * * * * else{ * * * * * h = Reverse(h); * * * * * Split(&h, &h1, &h2); * * * * } * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * break; * * * default: printf("±z™∫øȧJ¶≥ª~°I\n"); * * * case 8: help(); * * } * } ! temp = (node*)malloc(sizeof(node)); ! temp->data = data; ! temp->next = p->next; ! p->next = temp; * return 0; } void print_list(node *h){ * node *temp; * temp = h; * while(temp != NULL){ * * printf("%d -> ", temp->data); * * temp = temp->next; * } * printf("NULL\n"); } node *Insert(int data, node *h){ * node *p, *t, *temp; * if(h==NULL){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = NULL; * * return temp; * } * p = h; * t = h->next; * if(data<p->data){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = p; * * return temp; * } * if(t!=NULL) * * while(data<p->data || data>t->data){ * * * p = p->next; * * * t = t->next; * * * if(t==NULL) break; * * } * temp = (node*)malloc(sizeof(node)); * temp->data = data; * temp->next = p->next; * p->next = temp; * return h; } node *Delete(int data, node *h){ * node *p, *t; * if(h==NULL) return h; * p = h; * t = h->next; * if(data == p->data){ * * p = p->next; * * free(h); * * return p; * } * while(data!=t->data){ * * p = p->next; * * t = t->next; * * if(t==NULL) return h; * } * p->next = t->next; * free(t); * return h; } node *Search(int data, node *h){ * node *p=h; * while(p!=NULL && data!=p->data)* p = p->next; * return p; } int Count(node *h){ * int count=0; * while(h!=NULL){ * * count += 1; * * h = h->next; * } * return count; } node *Reverse(node *h){ * node *a, *b, *c; * if(h==NULL || h->next==NULL) return h; * a = h; * b = a->next; * c = b->next; * a->next = NULL; * while(c!=NULL){ * * b->next = a; * * a = b; * * b = c; * * c = c->next; * } * b->next = a; * order = !order; * return b; } node *Merge(node *h1, node *h2){ * node *h, *temp; * h = temp = h1->data < h2->data ? h1 : h2; * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * while(h1!=NULL && h2!=NULL){ * * temp = temp->next = h1->data < h2->data ? h1 : h2; * * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * } * h2 == NULL ? (temp->next=h1) : (temp->next=h2); * return h; } void Split(node **h, node **h1_ptr, node **h2_ptr){ * node *h1=NULL, *h2=NULL; * while(*h!=NULL){ * * if((*h)->data%2){ * * * if(h1==NULL) h1 = *h1_ptr = *h; * * * else *h1_ptr = (*h1_ptr)->next = *h; * * }else{ * * * if(h2==NULL) h2 = *h2_ptr = *h; * * * else *h2_ptr = (*h2_ptr)->next = *h; * * } * * *h = (*h)->next; * } * (*h1_ptr)->next = (*h2_ptr)->next = NULL; * *h1_ptr = h1; * *h2_ptr = h2; * *h = NULL; } void help(){ * printf("0.µ≤ßÙ\n"); * printf("1.Insert\n"); * printf("2.Delete\n"); * printf("3.Search\n"); * printf("4.Count\n"); * printf("5.Reverse\n"); * printf("6.Merge\n"); * printf("7.Split\n"); * printf("8.help\n"); } อᄣl อᄣl
  42. /*¶®•\§jæ«∏Í∞T§uµ{æ«®t98Ø≈§AØZ≤¶•…¨u æ«∏π°GF74942294*/ / ****************************************************************************** * FileName: hw7_s.c Programmer: CrBoy Purpose:

    ≥–≥y§@≠”singly linked list®√∞ı¶Ê¶U∫ÿ•\؇ Input: Output: the standard out Compilation: gcc hw7_s.c -o hw7_s Run: ./hw7_s Date: 2006/1/8 / ****************************************************************************** / #include <stdio.h> struct node{ * int data; * struct node *next; }; typedef struct node node; void print_list(node*);/*print_list(h); ¶C¶L•Hh∂}¿Y™∫linked list*/ node *Insert(int, node*);/*Insert(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥ °§Jdata®√¶^∂«∑s™∫h*/ node *Delete(int, node*);/*Delete(data, h); ¶b•Hh∂}¿Y™∫linked list§§ßR∞ £data®√¶^∂«∑s™∫h*/ node *Search(int, node*);/*Search(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥Mß ‰data®√∂«¶^data©“¶b™∫¶Ï∏m*/ int Count(node*);/*Count(h); ≠p∫‚•Hh∂}¿Y™∫linked list§§™∫∏`¬I≠”º∆*/ node *Reverse(node*);/*Reverse(h); §œß«±∆¶C•Hh∂}¿Y™∫linked list®√∂«¶^∑s™∫h*/ node *Merge(node*, node*);/*Merge(h1, h2); ¶X®÷h1ªPh2≥o2≠”linked list®√¶^∂«¶X®÷´·™∫™∫head*/ void Split(node**, node**, node**);/*Split(&h, &h1, &h2); §¿≥Œh≥o≠”linked list¨∞©_∞∏º∆®√§¿ßO¶s®Ïh1ªPh2§§*/ void help(); int order=1; int main(void){ ! node *h1=NULL, *h2=NULL; ! while(*h!=NULL){ ! ! if((*h)->data%2){ ! ! ! if(h1==NULL) h1 = *h1_ptr = *h; ! ! ! else *h1_ptr = (*h1_ptr)->next = *h; ! ! }else{ ! ! ! if(h2==NULL) h2 = *h2_ptr = *h; ! ! ! else *h2_ptr = (*h2_ptr)->next = *h; ! ! } ! ! *h = (*h)->next; ! } ! (*h1_ptr)->next = (*h2_ptr)->next = NULL; ! *h1_ptr = h1; ! *h2_ptr = h2; ! *h = NULL; * int sel=8, data=0; * node *h=NULL, *h1=NULL, *h2=NULL; * help(); * while(sel){ * * printf("\n•ÿ´e™∫Linked list°G"); * * print_list(h); * * printf("Ω–øÔæ‹•\\؇°G"); * * if(scanf("%d", &sel)==0){ * * * sel=-1; * * * fflush(stdin); * * } * * switch(sel){ * * * case 0: break; * * * case 1: * * * * printf("Ω–øȧJ±˝¥°§J™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * if(order) * * * * * h = Insert(data, h); * * * * else{ * * * * * h = Reverse(h); * * * * * h = Insert(data, h); * * * * * h = Reverse(h); * * * * } * * * * break; * * * case 2: * * * * printf("Ω–øȧJ±˝ßR∞£™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * if(order) * * * * * h = Delete(data, h); * * * * else{ * * * * * h = Reverse(h); * * * * * h = Delete(data, h); * * * * * h = Reverse(h); * * * * } * * * * break; * * * case 3: * * * * printf("Ω–øȧJ±˝∑j¥M™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * h1 = Search(data, h); * * * * printf("•H%dß@¨∞∞_¬I™∫Linked list°G", data); * * * * print_list(h1); * * * * h1 = NULL; * * * * break; * * * case 4: * * * * printf("•ÿ´e™∫Linked list¶@¶≥%d≠”node °C\n", Count(h)); * * * * break; * * * case 5: * * * * h = Reverse(h); * * * * break; * * * case 6: * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * h = Merge(h1, h2); * * * * h1 = h2 = NULL; * * * * break; * * * case 7: * * * * if(order) Split(&h, &h1, &h2); * * * * else{ * * * * * h = Reverse(h); * * * * * Split(&h, &h1, &h2); * * * * } * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * break; * * * default: printf("±z™∫øȧJ¶≥ª~°I\n"); * * * case 8: help(); * * } * } ! temp = (node*)malloc(sizeof(node)); ! temp->data = data; ! temp->next = p->next; ! p->next = temp; * return 0; } void print_list(node *h){ * node *temp; * temp = h; * while(temp != NULL){ * * printf("%d -> ", temp->data); * * temp = temp->next; * } * printf("NULL\n"); } node *Insert(int data, node *h){ * node *p, *t, *temp; * if(h==NULL){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = NULL; * * return temp; * } * p = h; * t = h->next; * if(data<p->data){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = p; * * return temp; * } * if(t!=NULL) * * while(data<p->data || data>t->data){ * * * p = p->next; * * * t = t->next; * * * if(t==NULL) break; * * } * temp = (node*)malloc(sizeof(node)); * temp->data = data; * temp->next = p->next; * p->next = temp; * return h; } node *Delete(int data, node *h){ * node *p, *t; * if(h==NULL) return h; * p = h; * t = h->next; * if(data == p->data){ * * p = p->next; * * free(h); * * return p; * } * while(data!=t->data){ * * p = p->next; * * t = t->next; * * if(t==NULL) return h; * } * p->next = t->next; * free(t); * return h; } node *Search(int data, node *h){ * node *p=h; * while(p!=NULL && data!=p->data)* p = p->next; * return p; } int Count(node *h){ * int count=0; * while(h!=NULL){ * * count += 1; * * h = h->next; * } * return count; } node *Reverse(node *h){ * node *a, *b, *c; * if(h==NULL || h->next==NULL) return h; * a = h; * b = a->next; * c = b->next; * a->next = NULL; ! while(c!=NULL){ ! ! b->next = a; ! ! a = b; ! ! b = c; ! ! c = c->next; ! } * b->next = a; * order = !order; * return b; } node *Merge(node *h1, node *h2){ * node *h, *temp; * h = temp = h1->data < h2->data ? h1 : h2; * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * while(h1!=NULL && h2!=NULL){ * * temp = temp->next = h1->data < h2->data ? h1 : h2; * * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * } ! while(c!=NULL){ ! ! b->next = a; ! ! a = b; ! ! b = c; ! ! c = c->next; ! } * h2 == NULL ? (temp->next=h1) : (temp->next=h2); * return h; } void Split(node **h, node **h1_ptr, node **h2_ptr){ * node *h1=NULL, *h2=NULL; * while(*h!=NULL){ * * if((*h)->data%2){ * * * if(h1==NULL) h1 = *h1_ptr = *h; * * * else *h1_ptr = (*h1_ptr)->next = *h; * * }else{ * * * if(h2==NULL) h2 = *h2_ptr = *h; * * * else *h2_ptr = (*h2_ptr)->next = *h; * * } * * *h = (*h)->next; * } * (*h1_ptr)->next = (*h2_ptr)->next = NULL; * *h1_ptr = h1; * *h2_ptr = h2; * *h = NULL; } void help(){ * printf("0.µ≤ßÙ\n"); * printf("1.Insert\n"); * printf("2.Delete\n"); * printf("3.Search\n"); * printf("4.Count\n"); * printf("5.Reverse\n"); * printf("6.Merge\n"); * printf("7.Split\n"); * printf("8.help\n"); } อᄣl мৰl
  43. /*¶®•\§jæ«∏Í∞T§uµ{æ«®t98Ø≈§AØZ≤¶•…¨u æ«∏π°GF74942294*/ / ****************************************************************************** * FileName: hw7_s.c Programmer: CrBoy Purpose:

    ≥–≥y§@≠”singly linked list®√∞ı¶Ê¶U∫ÿ•\؇ Input: Output: the standard out Compilation: gcc hw7_s.c -o hw7_s Run: ./hw7_s Date: 2006/1/8 / ****************************************************************************** / #include <stdio.h> struct node{ * int data; * struct node *next; }; typedef struct node node; void print_list(node*);/*print_list(h); ¶C¶L•Hh∂}¿Y™∫linked list*/ node *Insert(int, node*);/*Insert(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥ °§Jdata®√¶^∂«∑s™∫h*/ node *Delete(int, node*);/*Delete(data, h); ¶b•Hh∂}¿Y™∫linked list§§ßR∞ £data®√¶^∂«∑s™∫h*/ node *Search(int, node*);/*Search(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥Mß ‰data®√∂«¶^data©“¶b™∫¶Ï∏m*/ int Count(node*);/*Count(h); ≠p∫‚•Hh∂}¿Y™∫linked list§§™∫∏`¬I≠”º∆*/ node *Reverse(node*);/*Reverse(h); §œß«±∆¶C•Hh∂}¿Y™∫linked list®√∂«¶^∑s™∫h*/ node *Merge(node*, node*);/*Merge(h1, h2); ¶X®÷h1ªPh2≥o2≠”linked list®√¶^∂«¶X®÷´·™∫™∫head*/ void Split(node**, node**, node**);/*Split(&h, &h1, &h2); §¿≥Œh≥o≠”linked list¨∞©_∞∏º∆®√§¿ßO¶s®Ïh1ªPh2§§*/ void help(); int order=1; int main(void){ ! node *h1=NULL, *h2=NULL; ! while(*h!=NULL){ ! ! if((*h)->data%2){ ! ! ! if(h1==NULL) h1 = *h1_ptr = *h; ! ! ! else *h1_ptr = (*h1_ptr)->next = *h; ! ! }else{ ! ! ! if(h2==NULL) h2 = *h2_ptr = *h; ! ! ! else *h2_ptr = (*h2_ptr)->next = *h; ! ! } ! ! *h = (*h)->next; ! } ! (*h1_ptr)->next = (*h2_ptr)->next = NULL; ! *h1_ptr = h1; ! *h2_ptr = h2; ! *h = NULL; * int sel=8, data=0; * node *h=NULL, *h1=NULL, *h2=NULL; * help(); * while(sel){ * * printf("\n•ÿ´e™∫Linked list°G"); * * print_list(h); * * printf("Ω–øÔæ‹•\\؇°G"); * * if(scanf("%d", &sel)==0){ * * * sel=-1; * * * fflush(stdin); * * } * * switch(sel){ * * * case 0: break; ! ! ! case 1: ! ! ! ! printf("Ω–øȧJ±˝¥°§J™∫愺∆≠»°G"); ! ! ! ! if(scanf("%d", &data)==0) continue; ! ! ! ! if(order) ! ! ! ! ! h = Insert(data, h); ! ! ! ! else{ ! ! ! ! ! h = Reverse(h); ! ! ! ! ! h = Insert(data, h); ! ! ! ! ! h = Reverse(h); ! ! ! ! } ! ! ! ! break; ! ! ! case 2: ! ! ! ! printf("Ω–øȧJ±˝ßR∞£™∫愺∆≠»°G"); ! ! ! ! if(scanf("%d", &data)==0) continue; ! ! ! ! if(order) ! ! ! ! ! h = Delete(data, h); ! ! ! ! else{ ! ! ! ! ! h = Reverse(h); ! ! ! ! ! h = Delete(data, h); ! ! ! ! ! h = Reverse(h); ! ! ! ! } ! ! ! ! break; * * * case 3: * * * * printf("Ω–øȧJ±˝∑j¥M™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * h1 = Search(data, h); * * * * printf("•H%dß@¨∞∞_¬I™∫Linked list°G", data); * * * * print_list(h1); * * * * h1 = NULL; * * * * break; * * * case 4: * * * * printf("•ÿ´e™∫Linked list¶@¶≥%d≠”node °C\n", Count(h)); * * * * break; * * * case 5: * * * * h = Reverse(h); * * * * break; * * * case 6: * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * h = Merge(h1, h2); * * * * h1 = h2 = NULL; * * * * break; * * * case 7: * * * * if(order) Split(&h, &h1, &h2); * * * * else{ * * * * * h = Reverse(h); * * * * * Split(&h, &h1, &h2); * * * * } * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * break; * * * default: printf("±z™∫øȧJ¶≥ª~°I\n"); * * * case 8: help(); * * } * } ! temp = (node*)malloc(sizeof(node)); ! temp->data = data; ! temp->next = p->next; ! p->next = temp; * return 0; } void print_list(node *h){ * node *temp; * temp = h; * while(temp != NULL){ * * printf("%d -> ", temp->data); * * temp = temp->next; * } * printf("NULL\n"); } node *Insert(int data, node *h){ * node *p, *t, *temp; * if(h==NULL){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = NULL; * * return temp; * } * p = h; ! (*h1_ptr)->next = (*h2_ptr)->next = NULL; ! *h1_ptr = h1; ! *h2_ptr = h2; ! *h = NULL; * t = h->next; * if(data<p->data){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = p; * * return temp; * } * if(t!=NULL) * * while(data<p->data || data>t->data){ * * * p = p->next; * * * t = t->next; * * * if(t==NULL) break; * * } * temp = (node*)malloc(sizeof(node)); * temp->data = data; * temp->next = p->next; * p->next = temp; ! node *h=NULL, *h1=NULL, *h2=NULL; ! help(); * return h; } node *Delete(int data, node *h){ * node *p, *t; * if(h==NULL) return h; * p = h; * t = h->next; * if(data == p->data){ * * p = p->next; * * free(h); * * return p; * } * while(data!=t->data){ * * p = p->next; * * t = t->next; * * if(t==NULL) return h; * } * p->next = t->next; * free(t); * return h; } node *Search(int data, node *h){ ! node *p=h; ! while(p!=NULL && data!=p->data)! p = p->next; ! return p; } int Count(node *h){ ! int count=0; ! while(h!=NULL){ ! ! count += 1; ! ! h = h->next; ! } ! return count; } node *Reverse(node *h){ * node *a, *b, *c; * if(h==NULL || h->next==NULL) return h; * a = h; * b = a->next; * c = b->next; * a->next = NULL; ! while(c!=NULL){ ! ! b->next = a; ! ! a = b; ! ! b = c; ! ! c = c->next; ! } * b->next = a; * order = !order; * return b; } node *Merge(node *h1, node *h2){ * node *h, *temp; * h = temp = h1->data < h2->data ? h1 : h2; * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * while(h1!=NULL && h2!=NULL){ * * temp = temp->next = h1->data < h2->data ? h1 : h2; * * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * } ! while(c!=NULL){ ! ! b->next = a; ! ! a = b; ! ! b = c; ! ! c = c->next; ! } * h2 == NULL ? (temp->next=h1) : (temp->next=h2); * return h; } void Split(node **h, node **h1_ptr, node **h2_ptr){ * node *h1=NULL, *h2=NULL; * while(*h!=NULL){ * * if((*h)->data%2){ * * * if(h1==NULL) h1 = *h1_ptr = *h; * * * else *h1_ptr = (*h1_ptr)->next = *h; * * }else{ * * * if(h2==NULL) h2 = *h2_ptr = *h; * * * else *h2_ptr = (*h2_ptr)->next = *h; * * } * * *h = (*h)->next; * } * (*h1_ptr)->next = (*h2_ptr)->next = NULL; * *h1_ptr = h1; * *h2_ptr = h2; * *h = NULL; } void help(){ * printf("0.µ≤ßÙ\n"); * printf("1.Insert\n"); * printf("2.Delete\n"); * printf("3.Search\n"); * printf("4.Count\n"); * printf("5.Reverse\n"); * printf("6.Merge\n"); * printf("7.Split\n"); * printf("8.help\n"); } อᄣl мৰl мৰl
  44. /*¶®•\§jæ«∏Í∞T§uµ{æ«®t98Ø≈§AØZ≤¶•…¨u æ«∏π°GF74942294*/ / ****************************************************************************** * FileName: hw7_s.c Programmer: CrBoy Purpose:

    ≥–≥y§@≠”singly linked list®√∞ı¶Ê¶U∫ÿ•\؇ Input: Output: the standard out Compilation: gcc hw7_s.c -o hw7_s Run: ./hw7_s Date: 2006/1/8 / ****************************************************************************** / #include <stdio.h> struct node{ * int data; * struct node *next; }; typedef struct node node; void print_list(node*);/*print_list(h); ¶C¶L•Hh∂}¿Y™∫linked list*/ node *Insert(int, node*);/*Insert(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥ °§Jdata®√¶^∂«∑s™∫h*/ node *Delete(int, node*);/*Delete(data, h); ¶b•Hh∂}¿Y™∫linked list§§ßR∞ £data®√¶^∂«∑s™∫h*/ node *Search(int, node*);/*Search(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥Mß ‰data®√∂«¶^data©“¶b™∫¶Ï∏m*/ int Count(node*);/*Count(h); ≠p∫‚•Hh∂}¿Y™∫linked list§§™∫∏`¬I≠”º∆*/ node *Reverse(node*);/*Reverse(h); §œß«±∆¶C•Hh∂}¿Y™∫linked list®√∂«¶^∑s™∫h*/ node *Merge(node*, node*);/*Merge(h1, h2); ¶X®÷h1ªPh2≥o2≠”linked list®√¶^∂«¶X®÷´·™∫™∫head*/ void Split(node**, node**, node**);/*Split(&h, &h1, &h2); §¿≥Œh≥o≠”linked list¨∞©_∞∏º∆®√§¿ßO¶s®Ïh1ªPh2§§*/ void help(); int order=1; int main(void){ ! node *h1=NULL, *h2=NULL; ! while(*h!=NULL){ ! ! if((*h)->data%2){ ! ! ! if(h1==NULL) h1 = *h1_ptr = *h; ! ! ! else *h1_ptr = (*h1_ptr)->next = *h; ! ! }else{ ! ! ! if(h2==NULL) h2 = *h2_ptr = *h; ! ! ! else *h2_ptr = (*h2_ptr)->next = *h; ! ! } ! ! *h = (*h)->next; ! } ! (*h1_ptr)->next = (*h2_ptr)->next = NULL; ! *h1_ptr = h1; ! *h2_ptr = h2; ! *h = NULL; * int sel=8, data=0; * node *h=NULL, *h1=NULL, *h2=NULL; * help(); * while(sel){ * * printf("\n•ÿ´e™∫Linked list°G"); * * print_list(h); * * printf("Ω–øÔæ‹•\\؇°G"); * * if(scanf("%d", &sel)==0){ * * * sel=-1; * * * fflush(stdin); * * } * * switch(sel){ * * * case 0: break; ! ! ! case 1: ! ! ! ! printf("Ω–øȧJ±˝¥°§J™∫愺∆≠»°G"); ! ! ! ! if(scanf("%d", &data)==0) continue; ! ! ! ! if(order) ! ! ! ! ! h = Insert(data, h); ! ! ! ! else{ ! ! ! ! ! h = Reverse(h); ! ! ! ! ! h = Insert(data, h); ! ! ! ! ! h = Reverse(h); ! ! ! ! } ! ! ! ! break; ! ! ! case 2: ! ! ! ! printf("Ω–øȧJ±˝ßR∞£™∫愺∆≠»°G"); ! ! ! ! if(scanf("%d", &data)==0) continue; ! ! ! ! if(order) ! ! ! ! ! h = Delete(data, h); ! ! ! ! else{ ! ! ! ! ! h = Reverse(h); ! ! ! ! ! h = Delete(data, h); ! ! ! ! ! h = Reverse(h); ! ! ! ! } ! ! ! ! break; * * * case 3: * * * * printf("Ω–øȧJ±˝∑j¥M™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * h1 = Search(data, h); * * * * printf("•H%dß@¨∞∞_¬I™∫Linked list°G", data); * * * * print_list(h1); * * * * h1 = NULL; * * * * break; * * * case 4: * * * * printf("•ÿ´e™∫Linked list¶@¶≥%d≠”node °C\n", Count(h)); * * * * break; * * * case 5: * * * * h = Reverse(h); * * * * break; * * * case 6: * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * h = Merge(h1, h2); * * * * h1 = h2 = NULL; * * * * break; * * * case 7: * * * * if(order) Split(&h, &h1, &h2); * * * * else{ * * * * * h = Reverse(h); * * * * * Split(&h, &h1, &h2); * * * * } * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * break; * * * default: printf("±z™∫øȧJ¶≥ª~°I\n"); * * * case 8: help(); * * } * } ! temp = (node*)malloc(sizeof(node)); ! temp->data = data; ! temp->next = p->next; ! p->next = temp; * return 0; } void print_list(node *h){ * node *temp; * temp = h; * while(temp != NULL){ * * printf("%d -> ", temp->data); * * temp = temp->next; * } * printf("NULL\n"); } node *Insert(int data, node *h){ * node *p, *t, *temp; * if(h==NULL){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = NULL; * * return temp; * } * p = h; ! (*h1_ptr)->next = (*h2_ptr)->next = NULL; ! *h1_ptr = h1; ! *h2_ptr = h2; ! *h = NULL; * t = h->next; * if(data<p->data){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = p; * * return temp; * } * if(t!=NULL) * * while(data<p->data || data>t->data){ * * * p = p->next; * * * t = t->next; * * * if(t==NULL) break; * * } * temp = (node*)malloc(sizeof(node)); * temp->data = data; * temp->next = p->next; * p->next = temp; ! node *h=NULL, *h1=NULL, *h2=NULL; ! help(); * return h; } node *Delete(int data, node *h){ * node *p, *t; * if(h==NULL) return h; * p = h; * t = h->next; * if(data == p->data){ * * p = p->next; * * free(h); * * return p; * } * while(data!=t->data){ * * p = p->next; * * t = t->next; * * if(t==NULL) return h; * } * p->next = t->next; * free(t); * return h; } node *Search(int data, node *h){ ! node *p=h; ! while(p!=NULL && data!=p->data)! p = p->next; ! return p; } int Count(node *h){ ! int count=0; ! while(h!=NULL){ ! ! count += 1; ! ! h = h->next; ! } ! return count; } node *Reverse(node *h){ * node *a, *b, *c; * if(h==NULL || h->next==NULL) return h; * a = h; * b = a->next; * c = b->next; * a->next = NULL; ! while(c!=NULL){ ! ! b->next = a; ! ! a = b; ! ! b = c; ! ! c = c->next; ! } * b->next = a; * order = !order; * return b; } node *Merge(node *h1, node *h2){ * node *h, *temp; * h = temp = h1->data < h2->data ? h1 : h2; * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * while(h1!=NULL && h2!=NULL){ * * temp = temp->next = h1->data < h2->data ? h1 : h2; * * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * } ! while(c!=NULL){ ! ! b->next = a; ! ! a = b; ! ! b = c; ! ! c = c->next; ! } * h2 == NULL ? (temp->next=h1) : (temp->next=h2); * return h; } void Split(node **h, node **h1_ptr, node **h2_ptr){ * node *h1=NULL, *h2=NULL; * while(*h!=NULL){ * * if((*h)->data%2){ * * * if(h1==NULL) h1 = *h1_ptr = *h; * * * else *h1_ptr = (*h1_ptr)->next = *h; * * }else{ * * * if(h2==NULL) h2 = *h2_ptr = *h; * * * else *h2_ptr = (*h2_ptr)->next = *h; * * } * * *h = (*h)->next; * } * (*h1_ptr)->next = (*h2_ptr)->next = NULL; * *h1_ptr = h1; * *h2_ptr = h2; * *h = NULL; } void print_list(node *h){ ! node *temp; ! temp = h; ! while(temp != NULL){ ! ! printf("%d -> ", temp->data); ! ! temp = temp->next; ! } ! printf("NULL\n"); } void help(){ * printf("0.µ≤ßÙ\n"); * printf("1.Insert\n"); * printf("2.Delete\n"); * printf("3.Search\n"); * printf("4.Count\n"); * printf("5.Reverse\n"); * printf("6.Merge\n"); * printf("7.Split\n"); * printf("8.help\n"); อᄣl мৰl
  45. ЫڀəՇ˂

  46. ഐ؈̌ঐᄳᙻə

  47. ɦڀՇ˂Ҫ$0%&ҷΫԸ

  48. /*¶®•\§jæ«∏Í∞T§uµ{æ«®t98Ø≈§AØZ≤¶•…¨u æ«∏π°GF74942294*/ / ****************************************************************************** * FileName: hw7_s.c Programmer: CrBoy Purpose:

    ≥–≥y§@≠”singly linked list®√∞ı¶Ê¶U∫ÿ•\؇ Input: Output: the standard out Compilation: gcc hw7_s.c -o hw7_s Run: ./hw7_s Date: 2006/1/8 / ****************************************************************************** / #include <stdio.h> struct node{ * int data; * struct node *next; }; typedef struct node node; void print_list(node*);/*print_list(h); ¶C¶L•Hh∂}¿Y™∫linked list*/ node *Insert(int, node*);/*Insert(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥ °§Jdata®√¶^∂«∑s™∫h*/ node *Delete(int, node*);/*Delete(data, h); ¶b•Hh∂}¿Y™∫linked list§§ßR∞ £data®√¶^∂«∑s™∫h*/ node *Search(int, node*);/*Search(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥Mß ‰data®√∂«¶^data©“¶b™∫¶Ï∏m*/ int Count(node*);/*Count(h); ≠p∫‚•Hh∂}¿Y™∫linked list§§™∫∏`¬I≠”º∆*/ node *Reverse(node*);/*Reverse(h); §œß«±∆¶C•Hh∂}¿Y™∫linked list®√∂«¶^∑s™∫h*/ node *Merge(node*, node*);/*Merge(h1, h2); ¶X®÷h1ªPh2≥o2≠”linked list®√¶^∂«¶X®÷´·™∫™∫head*/ void Split(node**, node**, node**);/*Split(&h, &h1, &h2); §¿≥Œh≥o≠”linked list¨∞©_∞∏º∆®√§¿ßO¶s®Ïh1ªPh2§§*/ void help(); int order=1; int main(void){ ! node *h1=NULL, *h2=NULL; ! while(*h!=NULL){ ! ! if((*h)->data%2){ ! ! ! if(h1==NULL) h1 = *h1_ptr = *h; ! ! ! else *h1_ptr = (*h1_ptr)->next = *h; ! ! }else{ ! ! ! if(h2==NULL) h2 = *h2_ptr = *h; ! ! ! else *h2_ptr = (*h2_ptr)->next = *h; ! ! } ! ! *h = (*h)->next; ! } ! (*h1_ptr)->next = (*h2_ptr)->next = NULL; ! *h1_ptr = h1; ! *h2_ptr = h2; ! *h = NULL; * int sel=8, data=0; * node *h=NULL, *h1=NULL, *h2=NULL; * help(); * while(sel){ * * printf("\n•ÿ´e™∫Linked list°G"); * * print_list(h); * * printf("Ω–øÔæ‹•\\؇°G"); * * if(scanf("%d", &sel)==0){ * * * sel=-1; * * * fflush(stdin); * * } * * switch(sel){ * * * case 0: break; ! ! ! case 1: ! ! ! ! printf("Ω–øȧJ±˝¥°§J™∫愺∆≠»°G"); ! ! ! ! if(scanf("%d", &data)==0) continue; ! ! ! ! if(order) ! ! ! ! ! h = Insert(data, h); ! ! ! ! else{ ! ! ! ! ! h = Reverse(h); ! ! ! ! ! h = Insert(data, h); ! ! ! ! ! h = Reverse(h); ! ! ! ! } ! ! ! ! break; ! ! ! case 2: ! ! ! ! printf("Ω–øȧJ±˝ßR∞£™∫愺∆≠»°G"); ! ! ! ! if(scanf("%d", &data)==0) continue; ! ! ! ! if(order) ! ! ! ! ! h = Delete(data, h); ! ! ! ! else{ ! ! ! ! ! h = Reverse(h); ! ! ! ! ! h = Delete(data, h); ! ! ! ! ! h = Reverse(h); ! ! ! ! } ! ! ! ! break; * * * case 3: * * * * printf("Ω–øȧJ±˝∑j¥M™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * h1 = Search(data, h); * * * * printf("•H%dß@¨∞∞_¬I™∫Linked list°G", data); * * * * print_list(h1); * * * * h1 = NULL; * * * * break; * * * case 4: * * * * printf("•ÿ´e™∫Linked list¶@¶≥%d≠”node °C\n", Count(h)); * * * * break; * * * case 5: * * * * h = Reverse(h); * * * * break; * * * case 6: * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * h = Merge(h1, h2); * * * * h1 = h2 = NULL; * * * * break; * * * case 7: * * * * if(order) Split(&h, &h1, &h2); * * * * else{ * * * * * h = Reverse(h); * * * * * Split(&h, &h1, &h2); * * * * } * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * break; * * * default: printf("±z™∫øȧJ¶≥ª~°I\n"); * * * case 8: help(); * * } * } ! temp = (node*)malloc(sizeof(node)); ! temp->data = data; ! temp->next = p->next; ! p->next = temp; * return 0; } void print_list(node *h){ * node *temp; * temp = h; * while(temp != NULL){ * * printf("%d -> ", temp->data); * * temp = temp->next; * } * printf("NULL\n"); } node *Insert(int data, node *h){ * node *p, *t, *temp; * if(h==NULL){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = NULL; * * return temp; * } * p = h; ! (*h1_ptr)->next = (*h2_ptr)->next = NULL; ! *h1_ptr = h1; ! *h2_ptr = h2; ! *h = NULL; * t = h->next; * if(data<p->data){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = p; * * return temp; * } * if(t!=NULL) * * while(data<p->data || data>t->data){ * * * p = p->next; * * * t = t->next; * * * if(t==NULL) break; * * } * temp = (node*)malloc(sizeof(node)); * temp->data = data; * temp->next = p->next; * p->next = temp; ! node *h=NULL, *h1=NULL, *h2=NULL; ! help(); * return h; } node *Delete(int data, node *h){ * node *p, *t; * if(h==NULL) return h; * p = h; * t = h->next; * if(data == p->data){ * * p = p->next; * * free(h); * * return p; * } * while(data!=t->data){ * * p = p->next; * * t = t->next; * * if(t==NULL) return h; * } * p->next = t->next; * free(t); * return h; } node *Search(int data, node *h){ ! node *p=h; ! while(p!=NULL && data!=p->data)! p = p->next; ! return p; } int Count(node *h){ ! int count=0; ! while(h!=NULL){ ! ! count += 1; ! ! h = h->next; ! } ! return count; } node *Reverse(node *h){ * node *a, *b, *c; * if(h==NULL || h->next==NULL) return h; * a = h; * b = a->next; * c = b->next; * a->next = NULL; ! while(c!=NULL){ ! ! b->next = a; ! ! a = b; ! ! b = c; ! ! c = c->next; ! } * b->next = a; * order = !order; * return b; } node *Merge(node *h1, node *h2){ * node *h, *temp; * h = temp = h1->data < h2->data ? h1 : h2; * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * while(h1!=NULL && h2!=NULL){ * * temp = temp->next = h1->data < h2->data ? h1 : h2; * * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * } ! while(c!=NULL){ ! ! b->next = a; ! ! a = b; ! ! b = c; ! ! c = c->next; ! } * h2 == NULL ? (temp->next=h1) : (temp->next=h2); * return h; } void Split(node **h, node **h1_ptr, node **h2_ptr){ * node *h1=NULL, *h2=NULL; * while(*h!=NULL){ * * if((*h)->data%2){ * * * if(h1==NULL) h1 = *h1_ptr = *h; * * * else *h1_ptr = (*h1_ptr)->next = *h; * * }else{ * * * if(h2==NULL) h2 = *h2_ptr = *h; * * * else *h2_ptr = (*h2_ptr)->next = *h; * * } * * *h = (*h)->next; * } * (*h1_ptr)->next = (*h2_ptr)->next = NULL; * *h1_ptr = h1; * *h2_ptr = h2; * *h = NULL; } void print_list(node *h){ ! node *temp; ! temp = h; ! while(temp != NULL){ ! ! printf("%d -> ", temp->data); ! ! temp = temp->next; ! } ! printf("NULL\n"); } void help(){ * printf("0.µ≤ßÙ\n"); * printf("1.Insert\n"); * printf("2.Delete\n"); * printf("3.Search\n"); * printf("4.Count\n"); * printf("5.Reverse\n"); * printf("6.Merge\n"); * printf("7.Split\n"); * printf("8.help\n");
  49. /*¶®•\§jæ«∏Í∞T§uµ{æ«®t98Ø≈§AØZ≤¶•…¨u æ«∏π°GF74942294*/ / ****************************************************************************** * FileName: hw7_s.c Programmer: CrBoy Purpose:

    ≥–≥y§@≠”singly linked list®√∞ı¶Ê¶U∫ÿ•\؇ Input: Output: the standard out Compilation: gcc hw7_s.c -o hw7_s Run: ./hw7_s Date: 2006/1/8 / ****************************************************************************** / #include <stdio.h> struct node{ * int data; * struct node *next; }; typedef struct node node; void print_list(node*);/*print_list(h); ¶C¶L•Hh∂}¿Y™∫linked list*/ node *Insert(int, node*);/*Insert(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥ °§Jdata®√¶^∂«∑s™∫h*/ node *Delete(int, node*);/*Delete(data, h); ¶b•Hh∂}¿Y™∫linked list§§ßR∞ £data®√¶^∂«∑s™∫h*/ node *Search(int, node*);/*Search(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥Mß ‰data®√∂«¶^data©“¶b™∫¶Ï∏m*/ int Count(node*);/*Count(h); ≠p∫‚•Hh∂}¿Y™∫linked list§§™∫∏`¬I≠”º∆*/ node *Reverse(node*);/*Reverse(h); §œß«±∆¶C•Hh∂}¿Y™∫linked list®√∂«¶^∑s™∫h*/ node *Merge(node*, node*);/*Merge(h1, h2); ¶X®÷h1ªPh2≥o2≠”linked list®√¶^∂«¶X®÷´·™∫™∫head*/ void Split(node**, node**, node**);/*Split(&h, &h1, &h2); §¿≥Œh≥o≠”linked list¨∞©_∞∏º∆®√§¿ßO¶s®Ïh1ªPh2§§*/ void help(); int order=1; int main(void){ ! node *h1=NULL, *h2=NULL; ! while(*h!=NULL){ ! ! if((*h)->data%2){ ! ! ! if(h1==NULL) h1 = *h1_ptr = *h; ! ! ! else *h1_ptr = (*h1_ptr)->next = *h; ! ! }else{ ! ! ! if(h2==NULL) h2 = *h2_ptr = *h; ! ! ! else *h2_ptr = (*h2_ptr)->next = *h; ! ! } ! ! *h = (*h)->next; ! } ! (*h1_ptr)->next = (*h2_ptr)->next = NULL; ! *h1_ptr = h1; ! *h2_ptr = h2; ! *h = NULL; * int sel=8, data=0; * node *h=NULL, *h1=NULL, *h2=NULL; * help(); * while(sel){ * * printf("\n•ÿ´e™∫Linked list°G"); * * print_list(h); * * printf("Ω–øÔæ‹•\\؇°G"); * * if(scanf("%d", &sel)==0){ * * * sel=-1; * * * fflush(stdin); * * } * * switch(sel){ * * * case 0: break; ! ! ! case 1: ! ! ! ! printf("Ω–øȧJ±˝¥°§J™∫愺∆≠»°G"); ! ! ! ! if(scanf("%d", &data)==0) continue; ! ! ! ! if(order) ! ! ! ! ! h = Insert(data, h); ! ! ! ! else{ ! ! ! ! ! h = Reverse(h); ! ! ! ! ! h = Insert(data, h); ! ! ! ! ! h = Reverse(h); ! ! ! ! } ! ! ! ! break; ! ! ! case 2: ! ! ! ! printf("Ω–øȧJ±˝ßR∞£™∫愺∆≠»°G"); ! ! ! ! if(scanf("%d", &data)==0) continue; ! ! ! ! if(order) ! ! ! ! ! h = Delete(data, h); ! ! ! ! else{ ! ! ! ! ! h = Reverse(h); ! ! ! ! ! h = Delete(data, h); ! ! ! ! ! h = Reverse(h); ! ! ! ! } ! ! ! ! break; * * * case 3: * * * * printf("Ω–øȧJ±˝∑j¥M™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * h1 = Search(data, h); * * * * printf("•H%dß@¨∞∞_¬I™∫Linked list°G", data); * * * * print_list(h1); * * * * h1 = NULL; * * * * break; * * * case 4: * * * * printf("•ÿ´e™∫Linked list¶@¶≥%d≠”node °C\n", Count(h)); * * * * break; * * * case 5: * * * * h = Reverse(h); * * * * break; * * * case 6: * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * h = Merge(h1, h2); * * * * h1 = h2 = NULL; * * * * break; * * * case 7: * * * * if(order) Split(&h, &h1, &h2); * * * * else{ * * * * * h = Reverse(h); * * * * * Split(&h, &h1, &h2); * * * * } * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * break; * * * default: printf("±z™∫øȧJ¶≥ª~°I\n"); * * * case 8: help(); * * } * } ! temp = (node*)malloc(sizeof(node)); ! temp->data = data; ! temp->next = p->next; ! p->next = temp; * return 0; } void print_list(node *h){ * node *temp; * temp = h; * while(temp != NULL){ * * printf("%d -> ", temp->data); * * temp = temp->next; * } * printf("NULL\n"); } node *Insert(int data, node *h){ * node *p, *t, *temp; * if(h==NULL){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = NULL; * * return temp; * } * p = h; ! (*h1_ptr)->next = (*h2_ptr)->next = NULL; ! *h1_ptr = h1; ! *h2_ptr = h2; ! *h = NULL; * t = h->next; * if(data<p->data){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = p; * * return temp; * } * if(t!=NULL) * * while(data<p->data || data>t->data){ * * * p = p->next; * * * t = t->next; * * * if(t==NULL) break; * * } * temp = (node*)malloc(sizeof(node)); * temp->data = data; * temp->next = p->next; * p->next = temp; ! node *h=NULL, *h1=NULL, *h2=NULL; ! help(); * return h; } node *Delete(int data, node *h){ * node *p, *t; * if(h==NULL) return h; * p = h; * t = h->next; * if(data == p->data){ * * p = p->next; * * free(h); * * return p; * } * while(data!=t->data){ * * p = p->next; * * t = t->next; * * if(t==NULL) return h; * } * p->next = t->next; * free(t); * return h; } node *Search(int data, node *h){ ! node *p=h; ! while(p!=NULL && data!=p->data)! p = p->next; ! return p; } int Count(node *h){ ! int count=0; ! while(h!=NULL){ ! ! count += 1; ! ! h = h->next; ! } ! return count; } node *Reverse(node *h){ * node *a, *b, *c; * if(h==NULL || h->next==NULL) return h; * a = h; * b = a->next; * c = b->next; * a->next = NULL; ! while(c!=NULL){ ! ! b->next = a; ! ! a = b; ! ! b = c; ! ! c = c->next; ! } * b->next = a; * order = !order; * return b; } node *Merge(node *h1, node *h2){ * node *h, *temp; * h = temp = h1->data < h2->data ? h1 : h2; * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * while(h1!=NULL && h2!=NULL){ * * temp = temp->next = h1->data < h2->data ? h1 : h2; * * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * } ! while(c!=NULL){ ! ! b->next = a; ! ! a = b; ! ! b = c; ! ! c = c->next; ! } * h2 == NULL ? (temp->next=h1) : (temp->next=h2); * return h; } void Split(node **h, node **h1_ptr, node **h2_ptr){ * node *h1=NULL, *h2=NULL; * while(*h!=NULL){ * * if((*h)->data%2){ * * * if(h1==NULL) h1 = *h1_ptr = *h; * * * else *h1_ptr = (*h1_ptr)->next = *h; * * }else{ * * * if(h2==NULL) h2 = *h2_ptr = *h; * * * else *h2_ptr = (*h2_ptr)->next = *h; * * } * * *h = (*h)->next; * } * (*h1_ptr)->next = (*h2_ptr)->next = NULL; * *h1_ptr = h1; * *h2_ptr = h2; * *h = NULL; } void print_list(node *h){ ! node *temp; ! temp = h; ! while(temp != NULL){ ! ! printf("%d -> ", temp->data); ! ! temp = temp->next; ! } ! printf("NULL\n"); } void help(){ * printf("0.µ≤ßÙ\n"); * printf("1.Insert\n"); * printf("2.Delete\n"); * printf("3.Search\n"); * printf("4.Count\n"); * printf("5.Reverse\n"); * printf("6.Merge\n"); * printf("7.Split\n"); * printf("8.help\n"); ҷΫԸl
  50. /*¶®•\§jæ«∏Í∞T§uµ{æ«®t98Ø≈§AØZ≤¶•…¨u æ«∏π°GF74942294*/ / ****************************************************************************** * FileName: hw7_s.c Programmer: CrBoy Purpose:

    ≥–≥y§@≠”singly linked list®√∞ı¶Ê¶U∫ÿ•\؇ Input: Output: the standard out Compilation: gcc hw7_s.c -o hw7_s Run: ./hw7_s Date: 2006/1/8 / ****************************************************************************** / #include <stdio.h> struct node{ * int data; * struct node *next; }; typedef struct node node; void print_list(node*);/*print_list(h); ¶C¶L•Hh∂}¿Y™∫linked list*/ node *Insert(int, node*);/*Insert(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥ °§Jdata®√¶^∂«∑s™∫h*/ node *Delete(int, node*);/*Delete(data, h); ¶b•Hh∂}¿Y™∫linked list§§ßR∞ £data®√¶^∂«∑s™∫h*/ node *Search(int, node*);/*Search(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥Mß ‰data®√∂«¶^data©“¶b™∫¶Ï∏m*/ int Count(node*);/*Count(h); ≠p∫‚•Hh∂}¿Y™∫linked list§§™∫∏`¬I≠”º∆*/ node *Reverse(node*);/*Reverse(h); §œß«±∆¶C•Hh∂}¿Y™∫linked list®√∂«¶^∑s™∫h*/ node *Merge(node*, node*);/*Merge(h1, h2); ¶X®÷h1ªPh2≥o2≠”linked list®√¶^∂«¶X®÷´·™∫™∫head*/ void Split(node**, node**, node**);/*Split(&h, &h1, &h2); §¿≥Œh≥o≠”linked list¨∞©_∞∏º∆®√§¿ßO¶s®Ïh1ªPh2§§*/ void help(); int order=1; int main(void){ ! node *h1=NULL, *h2=NULL; ! while(*h!=NULL){ ! ! if((*h)->data%2){ ! ! ! if(h1==NULL) h1 = *h1_ptr = *h; ! ! ! else *h1_ptr = (*h1_ptr)->next = *h; ! ! }else{ ! ! ! if(h2==NULL) h2 = *h2_ptr = *h; ! ! ! else *h2_ptr = (*h2_ptr)->next = *h; ! ! } ! ! *h = (*h)->next; ! } ! (*h1_ptr)->next = (*h2_ptr)->next = NULL; ! *h1_ptr = h1; ! *h2_ptr = h2; ! *h = NULL; * int sel=8, data=0; * node *h=NULL, *h1=NULL, *h2=NULL; * help(); * while(sel){ * * printf("\n•ÿ´e™∫Linked list°G"); * * print_list(h); * * printf("Ω–øÔæ‹•\\؇°G"); * * if(scanf("%d", &sel)==0){ * * * sel=-1; * * * fflush(stdin); * * } * * switch(sel){ * * * case 0: break; ! ! ! case 1: ! ! ! ! printf("Ω–øȧJ±˝¥°§J™∫愺∆≠»°G"); ! ! ! ! if(scanf("%d", &data)==0) continue; ! ! ! ! if(order) ! ! ! ! ! h = Insert(data, h); ! ! ! ! else{ ! ! ! ! ! h = Reverse(h); ! ! ! ! ! h = Insert(data, h); ! ! ! ! ! h = Reverse(h); ! ! ! ! } ! ! ! ! break; ! ! ! case 2: ! ! ! ! printf("Ω–øȧJ±˝ßR∞£™∫愺∆≠»°G"); ! ! ! ! if(scanf("%d", &data)==0) continue; ! ! ! ! if(order) ! ! ! ! ! h = Delete(data, h); ! ! ! ! else{ ! ! ! ! ! h = Reverse(h); ! ! ! ! ! h = Delete(data, h); ! ! ! ! ! h = Reverse(h); ! ! ! ! } ! ! ! ! break; * * * case 3: * * * * printf("Ω–øȧJ±˝∑j¥M™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * h1 = Search(data, h); * * * * printf("•H%dß@¨∞∞_¬I™∫Linked list°G", data); * * * * print_list(h1); * * * * h1 = NULL; * * * * break; * * * case 4: * * * * printf("•ÿ´e™∫Linked list¶@¶≥%d≠”node °C\n", Count(h)); * * * * break; * * * case 5: * * * * h = Reverse(h); * * * * break; * * * case 6: * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * h = Merge(h1, h2); * * * * h1 = h2 = NULL; * * * * break; * * * case 7: * * * * if(order) Split(&h, &h1, &h2); * * * * else{ * * * * * h = Reverse(h); * * * * * Split(&h, &h1, &h2); * * * * } * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * break; * * * default: printf("±z™∫øȧJ¶≥ª~°I\n"); * * * case 8: help(); * * } * } ! temp = (node*)malloc(sizeof(node)); ! temp->data = data; ! temp->next = p->next; ! p->next = temp; * return 0; } void print_list(node *h){ * node *temp; * temp = h; * while(temp != NULL){ * * printf("%d -> ", temp->data); * * temp = temp->next; * } * printf("NULL\n"); } node *Insert(int data, node *h){ * node *p, *t, *temp; * if(h==NULL){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = NULL; * * return temp; * } * p = h; ! (*h1_ptr)->next = (*h2_ptr)->next = NULL; ! *h1_ptr = h1; ! *h2_ptr = h2; ! *h = NULL; * t = h->next; * if(data<p->data){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = p; * * return temp; * } * if(t!=NULL) * * while(data<p->data || data>t->data){ * * * p = p->next; * * * t = t->next; * * * if(t==NULL) break; * * } * temp = (node*)malloc(sizeof(node)); * temp->data = data; * temp->next = p->next; * p->next = temp; ! node *h=NULL, *h1=NULL, *h2=NULL; ! help(); * return h; } node *Delete(int data, node *h){ * node *p, *t; * if(h==NULL) return h; * p = h; * t = h->next; * if(data == p->data){ * * p = p->next; * * free(h); * * return p; * } * while(data!=t->data){ * * p = p->next; * * t = t->next; * * if(t==NULL) return h; * } * p->next = t->next; * free(t); * return h; } node *Search(int data, node *h){ ! node *p=h; ! while(p!=NULL && data!=p->data)! p = p->next; ! return p; } int Count(node *h){ ! int count=0; ! while(h!=NULL){ ! ! count += 1; ! ! h = h->next; ! } ! return count; } node *Reverse(node *h){ * node *a, *b, *c; * if(h==NULL || h->next==NULL) return h; * a = h; * b = a->next; * c = b->next; * a->next = NULL; ! while(c!=NULL){ ! ! b->next = a; ! ! a = b; ! ! b = c; ! ! c = c->next; ! } * b->next = a; * order = !order; * return b; } node *Merge(node *h1, node *h2){ * node *h, *temp; * h = temp = h1->data < h2->data ? h1 : h2; * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * while(h1!=NULL && h2!=NULL){ * * temp = temp->next = h1->data < h2->data ? h1 : h2; * * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * } ! while(c!=NULL){ ! ! b->next = a; ! ! a = b; ! ! b = c; ! ! c = c->next; ! } * h2 == NULL ? (temp->next=h1) : (temp->next=h2); * return h; } void Split(node **h, node **h1_ptr, node **h2_ptr){ * node *h1=NULL, *h2=NULL; * while(*h!=NULL){ * * if((*h)->data%2){ * * * if(h1==NULL) h1 = *h1_ptr = *h; * * * else *h1_ptr = (*h1_ptr)->next = *h; * * }else{ * * * if(h2==NULL) h2 = *h2_ptr = *h; * * * else *h2_ptr = (*h2_ptr)->next = *h; * * } * * *h = (*h)->next; * } * (*h1_ptr)->next = (*h2_ptr)->next = NULL; * *h1_ptr = h1; * *h2_ptr = h2; * *h = NULL; } void help(){ * printf("0.µ≤ßÙ\n"); * printf("1.Insert\n"); * printf("2.Delete\n"); * printf("3.Search\n"); * printf("4.Count\n"); * printf("5.Reverse\n"); * printf("6.Merge\n"); * printf("7.Split\n"); * printf("8.help\n"); } ҷΫԸl
  51. /*¶®•\§jæ«∏Í∞T§uµ{æ«®t98Ø≈§AØZ≤¶•…¨u æ«∏π°GF74942294*/ / ****************************************************************************** * FileName: hw7_s.c Programmer: CrBoy Purpose:

    ≥–≥y§@≠”singly linked list®√∞ı¶Ê¶U∫ÿ•\؇ Input: Output: the standard out Compilation: gcc hw7_s.c -o hw7_s Run: ./hw7_s Date: 2006/1/8 / ****************************************************************************** / #include <stdio.h> struct node{ * int data; * struct node *next; }; typedef struct node node; void print_list(node*);/*print_list(h); ¶C¶L•Hh∂}¿Y™∫linked list*/ node *Insert(int, node*);/*Insert(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥ °§Jdata®√¶^∂«∑s™∫h*/ node *Delete(int, node*);/*Delete(data, h); ¶b•Hh∂}¿Y™∫linked list§§ßR∞ £data®√¶^∂«∑s™∫h*/ node *Search(int, node*);/*Search(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥Mß ‰data®√∂«¶^data©“¶b™∫¶Ï∏m*/ int Count(node*);/*Count(h); ≠p∫‚•Hh∂}¿Y™∫linked list§§™∫∏`¬I≠”º∆*/ node *Reverse(node*);/*Reverse(h); §œß«±∆¶C•Hh∂}¿Y™∫linked list®√∂«¶^∑s™∫h*/ node *Merge(node*, node*);/*Merge(h1, h2); ¶X®÷h1ªPh2≥o2≠”linked list®√¶^∂«¶X®÷´·™∫™∫head*/ void Split(node**, node**, node**);/*Split(&h, &h1, &h2); §¿≥Œh≥o≠”linked list¨∞©_∞∏º∆®√§¿ßO¶s®Ïh1ªPh2§§*/ void help(); int order=1; int main(void){ ! node *h1=NULL, *h2=NULL; ! while(*h!=NULL){ ! ! if((*h)->data%2){ ! ! ! if(h1==NULL) h1 = *h1_ptr = *h; ! ! ! else *h1_ptr = (*h1_ptr)->next = *h; ! ! }else{ ! ! ! if(h2==NULL) h2 = *h2_ptr = *h; ! ! ! else *h2_ptr = (*h2_ptr)->next = *h; ! ! } ! ! *h = (*h)->next; ! } ! (*h1_ptr)->next = (*h2_ptr)->next = NULL; ! *h1_ptr = h1; ! *h2_ptr = h2; ! *h = NULL; * int sel=8, data=0; * node *h=NULL, *h1=NULL, *h2=NULL; * help(); * while(sel){ * * printf("\n•ÿ´e™∫Linked list°G"); * * print_list(h); * * printf("Ω–øÔæ‹•\\؇°G"); * * if(scanf("%d", &sel)==0){ * * * sel=-1; * * * fflush(stdin); * * } * * switch(sel){ * * * case 0: break; * * * case 1: * * * * printf("Ω–øȧJ±˝¥°§J™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * if(order) * * * * * h = Insert(data, h); * * * * else{ * * * * * h = Reverse(h); * * * * * h = Insert(data, h); * * * * * h = Reverse(h); * * * * } * * * * break; * * * case 2: * * * * printf("Ω–øȧJ±˝ßR∞£™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * if(order) * * * * * h = Delete(data, h); * * * * else{ * * * * * h = Reverse(h); * * * * * h = Delete(data, h); * * * * * h = Reverse(h); * * * * } * * * * break; * * * case 3: * * * * printf("Ω–øȧJ±˝∑j¥M™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * h1 = Search(data, h); * * * * printf("•H%dß@¨∞∞_¬I™∫Linked list°G", data); * * * * print_list(h1); * * * * h1 = NULL; * * * * break; * * * case 4: * * * * printf("•ÿ´e™∫Linked list¶@¶≥%d≠”node °C\n", Count(h)); * * * * break; * * * case 5: * * * * h = Reverse(h); * * * * break; * * * case 6: * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * h = Merge(h1, h2); * * * * h1 = h2 = NULL; * * * * break; * * * case 7: * * * * if(order) Split(&h, &h1, &h2); * * * * else{ * * * * * h = Reverse(h); * * * * * Split(&h, &h1, &h2); * * * * } * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * break; * * * default: printf("±z™∫øȧJ¶≥ª~°I\n"); * * * case 8: help(); * * } * } ! temp = (node*)malloc(sizeof(node)); ! temp->data = data; ! temp->next = p->next; ! p->next = temp; * return 0; } void print_list(node *h){ * node *temp; * temp = h; * while(temp != NULL){ * * printf("%d -> ", temp->data); * * temp = temp->next; * } * printf("NULL\n"); } node *Insert(int data, node *h){ * node *p, *t, *temp; * if(h==NULL){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = NULL; * * return temp; * } * p = h; * t = h->next; * if(data<p->data){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = p; * * return temp; * } * if(t!=NULL) * * while(data<p->data || data>t->data){ * * * p = p->next; * * * t = t->next; * * * if(t==NULL) break; * * } * temp = (node*)malloc(sizeof(node)); * temp->data = data; * temp->next = p->next; * p->next = temp; * return h; } node *Delete(int data, node *h){ * node *p, *t; * if(h==NULL) return h; * p = h; * t = h->next; * if(data == p->data){ * * p = p->next; * * free(h); * * return p; * } * while(data!=t->data){ * * p = p->next; * * t = t->next; * * if(t==NULL) return h; * } * p->next = t->next; * free(t); * return h; } node *Search(int data, node *h){ * node *p=h; * while(p!=NULL && data!=p->data)* p = p->next; * return p; } int Count(node *h){ * int count=0; * while(h!=NULL){ * * count += 1; * * h = h->next; * } * return count; } node *Reverse(node *h){ * node *a, *b, *c; * if(h==NULL || h->next==NULL) return h; * a = h; * b = a->next; * c = b->next; * a->next = NULL; ! while(c!=NULL){ ! ! b->next = a; ! ! a = b; ! ! b = c; ! ! c = c->next; ! } * b->next = a; * order = !order; * return b; } node *Merge(node *h1, node *h2){ * node *h, *temp; * h = temp = h1->data < h2->data ? h1 : h2; * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * while(h1!=NULL && h2!=NULL){ * * temp = temp->next = h1->data < h2->data ? h1 : h2; * * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * } ! while(c!=NULL){ ! ! b->next = a; ! ! a = b; ! ! b = c; ! ! c = c->next; ! } * h2 == NULL ? (temp->next=h1) : (temp->next=h2); * return h; } void Split(node **h, node **h1_ptr, node **h2_ptr){ * node *h1=NULL, *h2=NULL; * while(*h!=NULL){ * * if((*h)->data%2){ * * * if(h1==NULL) h1 = *h1_ptr = *h; * * * else *h1_ptr = (*h1_ptr)->next = *h; * * }else{ * * * if(h2==NULL) h2 = *h2_ptr = *h; * * * else *h2_ptr = (*h2_ptr)->next = *h; * * } * * *h = (*h)->next; * } * (*h1_ptr)->next = (*h2_ptr)->next = NULL; * *h1_ptr = h1; * *h2_ptr = h2; * *h = NULL; } void help(){ * printf("0.µ≤ßÙ\n"); * printf("1.Insert\n"); * printf("2.Delete\n"); * printf("3.Search\n"); * printf("4.Count\n"); * printf("5.Reverse\n"); * printf("6.Merge\n"); * printf("7.Split\n"); * printf("8.help\n"); } ҷΫԸҷΫԸҷΫԸl
  52. /*¶®•\§jæ«∏Í∞T§uµ{æ«®t98Ø≈§AØZ≤¶•…¨u æ«∏π°GF74942294*/ / ****************************************************************************** * FileName: hw7_s.c Programmer: CrBoy Purpose:

    ≥–≥y§@≠”singly linked list®√∞ı¶Ê¶U∫ÿ•\؇ Input: Output: the standard out Compilation: gcc hw7_s.c -o hw7_s Run: ./hw7_s Date: 2006/1/8 / ****************************************************************************** / #include <stdio.h> struct node{ * int data; * struct node *next; }; typedef struct node node; void print_list(node*);/*print_list(h); ¶C¶L•Hh∂}¿Y™∫linked list*/ node *Insert(int, node*);/*Insert(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥ °§Jdata®√¶^∂«∑s™∫h*/ node *Delete(int, node*);/*Delete(data, h); ¶b•Hh∂}¿Y™∫linked list§§ßR∞ £data®√¶^∂«∑s™∫h*/ node *Search(int, node*);/*Search(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥Mß ‰data®√∂«¶^data©“¶b™∫¶Ï∏m*/ int Count(node*);/*Count(h); ≠p∫‚•Hh∂}¿Y™∫linked list§§™∫∏`¬I≠”º∆*/ node *Reverse(node*);/*Reverse(h); §œß«±∆¶C•Hh∂}¿Y™∫linked list®√∂«¶^∑s™∫h*/ node *Merge(node*, node*);/*Merge(h1, h2); ¶X®÷h1ªPh2≥o2≠”linked list®√¶^∂«¶X®÷´·™∫™∫head*/ void Split(node**, node**, node**);/*Split(&h, &h1, &h2); §¿≥Œh≥o≠”linked list¨∞©_∞∏º∆®√§¿ßO¶s®Ïh1ªPh2§§*/ void help(); int order=1; int main(void){ ! node *h1=NULL, *h2=NULL; ! while(*h!=NULL){ ! ! if((*h)->data%2){ ! ! ! if(h1==NULL) h1 = *h1_ptr = *h; ! ! ! else *h1_ptr = (*h1_ptr)->next = *h; ! ! }else{ ! ! ! if(h2==NULL) h2 = *h2_ptr = *h; ! ! ! else *h2_ptr = (*h2_ptr)->next = *h; ! ! } ! ! *h = (*h)->next; ! } ! (*h1_ptr)->next = (*h2_ptr)->next = NULL; ! *h1_ptr = h1; ! *h2_ptr = h2; ! *h = NULL; * int sel=8, data=0; * node *h=NULL, *h1=NULL, *h2=NULL; * help(); * while(sel){ * * printf("\n•ÿ´e™∫Linked list°G"); * * print_list(h); * * printf("Ω–øÔæ‹•\\؇°G"); * * if(scanf("%d", &sel)==0){ * * * sel=-1; * * * fflush(stdin); * * } * * switch(sel){ * * * case 0: break; * * * case 1: * * * * printf("Ω–øȧJ±˝¥°§J™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * if(order) * * * * * h = Insert(data, h); * * * * else{ * * * * * h = Reverse(h); * * * * * h = Insert(data, h); * * * * * h = Reverse(h); * * * * } * * * * break; * * * case 2: * * * * printf("Ω–øȧJ±˝ßR∞£™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * if(order) * * * * * h = Delete(data, h); * * * * else{ * * * * * h = Reverse(h); * * * * * h = Delete(data, h); * * * * * h = Reverse(h); * * * * } * * * * break; * * * case 3: * * * * printf("Ω–øȧJ±˝∑j¥M™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * h1 = Search(data, h); * * * * printf("•H%dß@¨∞∞_¬I™∫Linked list°G", data); * * * * print_list(h1); * * * * h1 = NULL; * * * * break; * * * case 4: * * * * printf("•ÿ´e™∫Linked list¶@¶≥%d≠”node °C\n", Count(h)); * * * * break; * * * case 5: * * * * h = Reverse(h); * * * * break; * * * case 6: * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * h = Merge(h1, h2); * * * * h1 = h2 = NULL; * * * * break; * * * case 7: * * * * if(order) Split(&h, &h1, &h2); * * * * else{ * * * * * h = Reverse(h); * * * * * Split(&h, &h1, &h2); * * * * } * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * break; * * * default: printf("±z™∫øȧJ¶≥ª~°I\n"); * * * case 8: help(); * * } * } ! temp = (node*)malloc(sizeof(node)); ! temp->data = data; ! temp->next = p->next; ! p->next = temp; * return 0; } void print_list(node *h){ * node *temp; * temp = h; * while(temp != NULL){ * * printf("%d -> ", temp->data); * * temp = temp->next; * } * printf("NULL\n"); } node *Insert(int data, node *h){ * node *p, *t, *temp; * if(h==NULL){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = NULL; * * return temp; * } * p = h; * t = h->next; * if(data<p->data){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = p; * * return temp; * } * if(t!=NULL) * * while(data<p->data || data>t->data){ * * * p = p->next; * * * t = t->next; * * * if(t==NULL) break; * * } * temp = (node*)malloc(sizeof(node)); * temp->data = data; * temp->next = p->next; * p->next = temp; * return h; } node *Delete(int data, node *h){ * node *p, *t; * if(h==NULL) return h; * p = h; * t = h->next; * if(data == p->data){ * * p = p->next; * * free(h); * * return p; * } * while(data!=t->data){ * * p = p->next; * * t = t->next; * * if(t==NULL) return h; * } * p->next = t->next; * free(t); * return h; } node *Search(int data, node *h){ * node *p=h; * while(p!=NULL && data!=p->data)* p = p->next; * return p; } int Count(node *h){ * int count=0; * while(h!=NULL){ * * count += 1; * * h = h->next; * } * return count; } node *Reverse(node *h){ * node *a, *b, *c; * if(h==NULL || h->next==NULL) return h; * a = h; * b = a->next; * c = b->next; * a->next = NULL; * while(c!=NULL){ * * b->next = a; * * a = b; * * b = c; * * c = c->next; * } * b->next = a; * order = !order; * return b; } node *Merge(node *h1, node *h2){ * node *h, *temp; * h = temp = h1->data < h2->data ? h1 : h2; * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * while(h1!=NULL && h2!=NULL){ * * temp = temp->next = h1->data < h2->data ? h1 : h2; * * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * } * h2 == NULL ? (temp->next=h1) : (temp->next=h2); * return h; } void Split(node **h, node **h1_ptr, node **h2_ptr){ * node *h1=NULL, *h2=NULL; * while(*h!=NULL){ * * if((*h)->data%2){ * * * if(h1==NULL) h1 = *h1_ptr = *h; * * * else *h1_ptr = (*h1_ptr)->next = *h; * * }else{ * * * if(h2==NULL) h2 = *h2_ptr = *h; * * * else *h2_ptr = (*h2_ptr)->next = *h; * * } * * *h = (*h)->next; * } * (*h1_ptr)->next = (*h2_ptr)->next = NULL; * *h1_ptr = h1; * *h2_ptr = h2; * *h = NULL; } void help(){ * printf("0.µ≤ßÙ\n"); * printf("1.Insert\n"); * printf("2.Delete\n"); * printf("3.Search\n"); * printf("4.Count\n"); * printf("5.Reverse\n"); * printf("6.Merge\n"); * printf("7.Split\n"); * printf("8.help\n"); } ୕୕ҷΫԸl
  53. /*¶®•\§jæ«∏Í∞T§uµ{æ«®t98Ø≈§AØZ≤¶•…¨u æ«∏π°GF74942294*/ / ****************************************************************************** * FileName: hw7_s.c Programmer: CrBoy Purpose:

    ≥–≥y§@≠”singly linked list®√∞ı¶Ê¶U∫ÿ•\؇ Input: Output: the standard out Compilation: gcc hw7_s.c -o hw7_s Run: ./hw7_s Date: 2006/1/8 / ****************************************************************************** / #include <stdio.h> struct node{ * int data; * struct node *next; }; typedef struct node node; void print_list(node*);/*print_list(h); ¶C¶L•Hh∂}¿Y™∫linked list*/ node *Insert(int, node*);/*Insert(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥ °§Jdata®√¶^∂«∑s™∫h*/ node *Delete(int, node*);/*Delete(data, h); ¶b•Hh∂}¿Y™∫linked list§§ßR∞ £data®√¶^∂«∑s™∫h*/ node *Search(int, node*);/*Search(data, h); ¶b•Hh∂}¿Y™∫linked list§§¥Mß ‰data®√∂«¶^data©“¶b™∫¶Ï∏m*/ int Count(node*);/*Count(h); ≠p∫‚•Hh∂}¿Y™∫linked list§§™∫∏`¬I≠”º∆*/ node *Reverse(node*);/*Reverse(h); §œß«±∆¶C•Hh∂}¿Y™∫linked list®√∂«¶^∑s™∫h*/ node *Merge(node*, node*);/*Merge(h1, h2); ¶X®÷h1ªPh2≥o2≠”linked list®√¶^∂«¶X®÷´·™∫™∫head*/ void Split(node**, node**, node**);/*Split(&h, &h1, &h2); §¿≥Œh≥o≠”linked list¨∞©_∞∏º∆®√§¿ßO¶s®Ïh1ªPh2§§*/ void help(); int order=1; int main(void){ * int sel=8, data=0; * node *h=NULL, *h1=NULL, *h2=NULL; * help(); * while(sel){ * * printf("\n•ÿ´e™∫Linked list°G"); * * print_list(h); * * printf("Ω–øÔæ‹•\\؇°G"); * * if(scanf("%d", &sel)==0){ * * * sel=-1; * * * fflush(stdin); * * } * * switch(sel){ * * * case 0: break; * * * case 1: * * * * printf("Ω–øȧJ±˝¥°§J™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * if(order) * * * * * h = Insert(data, h); * * * * else{ * * * * * h = Reverse(h); * * * * * h = Insert(data, h); * * * * * h = Reverse(h); * * * * } * * * * break; * * * case 2: * * * * printf("Ω–øȧJ±˝ßR∞£™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * if(order) * * * * * h = Delete(data, h); * * * * else{ * * * * * h = Reverse(h); * * * * * h = Delete(data, h); * * * * * h = Reverse(h); * * * * } * * * * break; * * * case 3: * * * * printf("Ω–øȧJ±˝∑j¥M™∫愺∆≠»°G"); * * * * if(scanf("%d", &data)==0) continue; * * * * h1 = Search(data, h); * * * * printf("•H%dß@¨∞∞_¬I™∫Linked list°G", data); * * * * print_list(h1); * * * * h1 = NULL; * * * * break; * * * case 4: * * * * printf("•ÿ´e™∫Linked list¶@¶≥%d≠”node °C\n", Count(h)); * * * * break; * * * case 5: * * * * h = Reverse(h); * * * * break; * * * case 6: * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * h = Merge(h1, h2); * * * * h1 = h2 = NULL; * * * * break; * * * case 7: * * * * if(order) Split(&h, &h1, &h2); * * * * else{ * * * * * h = Reverse(h); * * * * * Split(&h, &h1, &h2); * * * * } * * * * printf("h1°G"); * * * * print_list(h1); * * * * printf("h2°G"); * * * * print_list(h2); * * * * break; * * * default: printf("±z™∫øȧJ¶≥ª~°I\n"); * * * case 8: help(); * * } * } * return 0; } void print_list(node *h){ * node *temp; * temp = h; * while(temp != NULL){ * * printf("%d -> ", temp->data); * * temp = temp->next; * } * printf("NULL\n"); } node *Insert(int data, node *h){ * node *p, *t, *temp; * if(h==NULL){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = NULL; * * return temp; * } * p = h; * t = h->next; * if(data<p->data){ * * temp = (node*)malloc(sizeof(node)); * * temp->data = data; * * temp->next = p; * * return temp; * } * if(t!=NULL) * * while(data<p->data || data>t->data){ * * * p = p->next; * * * t = t->next; * * * if(t==NULL) break; * * } * temp = (node*)malloc(sizeof(node)); * temp->data = data; * temp->next = p->next; * p->next = temp; * return h; } node *Delete(int data, node *h){ * node *p, *t; * if(h==NULL) return h; * p = h; * t = h->next; * if(data == p->data){ * * p = p->next; * * free(h); * * return p; * } * while(data!=t->data){ * * p = p->next; * * t = t->next; * * if(t==NULL) return h; * } * p->next = t->next; * free(t); * return h; } node *Search(int data, node *h){ * node *p=h; * while(p!=NULL && data!=p->data)* p = p->next; * return p; } int Count(node *h){ * int count=0; * while(h!=NULL){ * * count += 1; * * h = h->next; * } * return count; } node *Reverse(node *h){ * node *a, *b, *c; * if(h==NULL || h->next==NULL) return h; * a = h; * b = a->next; * c = b->next; * a->next = NULL; * while(c!=NULL){ * * b->next = a; * * a = b; * * b = c; * * c = c->next; * } * b->next = a; * order = !order; * return b; } node *Merge(node *h1, node *h2){ * node *h, *temp; * h = temp = h1->data < h2->data ? h1 : h2; * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * while(h1!=NULL && h2!=NULL){ * * temp = temp->next = h1->data < h2->data ? h1 : h2; * * h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); * } * h2 == NULL ? (temp->next=h1) : (temp->next=h2); * return h; } void Split(node **h, node **h1_ptr, node **h2_ptr){ * node *h1=NULL, *h2=NULL; * while(*h!=NULL){ * * if((*h)->data%2){ * * * if(h1==NULL) h1 = *h1_ptr = *h; * * * else *h1_ptr = (*h1_ptr)->next = *h; * * }else{ * * * if(h2==NULL) h2 = *h2_ptr = *h; * * * else *h2_ptr = (*h2_ptr)->next = *h; * * } * * *h = (*h)->next; * } * (*h1_ptr)->next = (*h2_ptr)->next = NULL; * *h1_ptr = h1; * *h2_ptr = h2; * *h = NULL; } void help(){ * printf("0.µ≤ßÙ\n"); * printf("1.Insert\n"); * printf("2.Delete\n"); * printf("3.Search\n"); * printf("4.Count\n"); * printf("5.Reverse\n"); * printf("6.Merge\n"); * printf("7.Split\n"); * printf("8.help\n"); } ॆٙҷΫԸə෗k ϞӚϞࡳ༁ҷ፹k
  54. None
  55. None
  56. None
  57. None
  58. None
  59. None
  60. None
  61. None
  62. None
  63. None
  64. None
  65. None
  66. ᒔϞ͜&9$&-া፽ҷəʡჿٙ

  67. ņħĦ ĥĤ੥ŀ ąͥ ą ŁᆖĤĥĦĨŇ

  68. ܘεɛΥЪ130+&$5ٙࣛࡉ

  69. Ңٙˢ༰λ! Ңˢ༰Ϙᄳλ!!!! ᛓҢٙఱ࿁əਢ ฀! ۘݹ਷ᘒ࣌!

  70. Ϟࣛࡉᒔึʔʃːႊદйɛٙ

  71. ଡ଼ࡰڌͪ....

  72. ņħĦ ĥĤ੥ŀ ąͥ ą ŁᆖĤĥĦĨŇ ൴

  73. ೻όணࠇࢪٙߕᅃ

  74. None
  75. (*5 The Stupid Content Tracker

  76. Ϟλεɛί͜Git Linux Android CakePHP Drupal GIMP jQuery GTK+ Qt phpBB

    Ruby on Rails PostgreSQL Git
  77. ʡჿ݊Git The Stupid Content Tracker งᚉٙʫ࢙৛ᔳኜk و͉છՓӻ୕ ʡჿ݊و͉kܣჿછՓk ࣛΈዚኜ ΫՑཀ̘

    ၾ ̻Бࣛ٤
  78. މʡჿࠅو͉છՓk াИ܀ɿٙϓڗཀ೻ ӊϣٙһอேٝ༸ਂəʡჿ ҷᙻ೻όʔ͜׊ ̙˸ΝࣛอᄣʔΝ̌ঐdɦʔʝ޴ᅂᚤ ᔊఊ˙کٙମή௪౪ (ԣจ̮dᒔ̙˸ԣʃɛ) ࢙׸ΥЪdҷᙻ೻όٙɛᒔપʔદப΂

  79. ʔ Ύ͜ Ꮶ Τ Ⴍ ݂ ԫ

  80. ʔᏑkLet’s Do Git!

  81. ΋Ըఙዧडٙ%FNPыl

  82. Gitৎ˓ό git COMMAND [ARGUMENTS] git COMMAND --help #޴຅ྼ͜!! clone -

    ልႡɛ࢕ٙ repository git clone git://github.com/git/hello-world.git init - ܔͭอٙ repository git init
  83. ண֛Git config git config -l git config --global user.name “CrBoy”

    git config --global user.email “crboy@crboy.net” git config --global color.ui auto git config --global alias.st status ~/.gitconfig
  84. Gitɛळೌ࢔̬ɽܸ˿ status - ݟ޶ͦۃً࿒ log - ݟ޶া፽ diff - ݟ޶ࢨମ

    show - ݟ޶त֛و͉
  85. Gitٙو͉ Repository, Stage (Index), and Working Copy و͉໮ٙڌͪk HEAD, HEAD~,

    HEAD~~, HEAD^# Branch Τ၈
  86. ܔͭอو͉ add - ਗ਼Ꮶࣩ̋ɝ Stage (Index) commit - ਗ਼ Stage

    (Index) ٙᏦࣩπɝ Repository و͉ᜊʷ൳ʃ൳λ ഛ͜ status ၾ diff add -p λ͜!!
  87. .gitignore ׁଫ̴l ׁଫ̴l ׁଫ̴l ׁଫ̴l ׁଫ̴l ഒ࿁ʔცࠅ஗ॶɝو͉છՓٙᏦࣩ ᅲπᏦeʕගᏦeা፽Ꮶ ͟೻όІਗପ͛ٙᏦࣩɽேʔცࠅو͉છՓ .gitignore

    வࡈᏦࣩ͉Ԓճk
  88. GitࣛΈዚኜ(ၚശਧ!!) checkout - ʲ౬Ցत֛و͉ branch - ପ͛ʱ˕ merge - ፄΥʔΝو͉

  89. ຅Gitஹɪၣ༩ push - ҪІʉٙ؇Гપ৔̘̈ pull - Ҫйɛٙ؇ГזΫԸ remote - Ⴣ၌޴ᗫ዁Ъ(Ϟܘεsubcommand)

  90. “Չ˼f” reset - ᜫ HEAD Ϋ๑Ցत֛و͉ stash - ᅲࣛπɨͦۃ working

    copydΫՑ HEAD cherry-pick - ܿ̈त֛و͉ٙࡌҷԸ apply blame - ᜑͪͦۃٙӊɓБʫ࢙ίࡳࡈو͉࠯ϣ̈ତ fetch - ՟੻Ⴣ၌ʫ࢙dШʔΥԻΫІʉٙ repo
  91. ޶logٙλʈՈ git log --graph gitk giggle tig GitX (Mac Only)

    GitHub.app (Mac Only)
  92. Դ͜(JUၾйɛ՘Ъ

  93. ɓԬʃҦ̷ ண֛ alias ڭܵ master މ̙͍੬༶Ъو͉ Դ͜ Github ၍ଣண֛Ꮶ

  94. Gitၾ׸຾ ؇ဏቍ͖〈׸ሞ〉j˜׸ɓΤϾўɧ່j׸ᔊɓɰiᜊ׸ ɚɰiʔ׸ɧɰf™ ᔊ׸ - Git ᐼ݊׀ྼٙᏍЫা፽ӊࡈو͉ٙ snapshot ᜊ׸ -

    Դ͜ Git ࣛdو͉ගٙᜊʷʃϾҞ஺ ʔ׸ - া፽ɨԸٙӊࡈو͉ٙʫ࢙༧༟ৃʔึ஗ҷᜊ
  95. (JUᒔϞܘε؇Г CVU ΋ึவᅵఱ੄ə

  96. ࿁ə

  97. و͉છՓӻ୕ ʔ݊ '51

  98. ˜̙ʔ̙˸Ҫ DPEF Ꮐᐵ͂̍ʘܝɪෂՑ HJUk™ œܔᙄɷຬʔࠅவᅵਂdɪϣϞɛவᅵਂdഐ؈ ˜ഐ؈ճk™ œഐ؈৛ᔳʔəو͉dܘʔ˙ک

  99. ($$  .",& GNU C and C++ Compiler Make

  100. None
  101. ԟԬ؇Гேί฀ྒk

  102. ೻όᇁ ੂБᏦ ?

  103. ೻όᇁ ੂБᏦ ᇜᙇ ଡ଼ᙇ ஹഐ

  104. ೻όᇁ ੂБᏦ GCC

  105. Ы̙ঐ̥ึ.... $ gcc -o hw1 hw1.c

  106. ЫႭʔ֛ᒔึ.... $ gcc -o hw2 main.c a.c b.c

  107. Ӛԟჿᔊఊ

  108. εᏦʱйᇜᙇ $ gcc -c main.c #ପ͛main.o $ gcc -c a.c

    #ପ͛a.o $ gcc -c b.c #ପ͛b.o $ gcc -o hw2 main.o a.o b.o
  109. ޶޶Preprocessorਂəṫk $ gcc -E program.c ̙͜Ըə༆#includeא݊#define࢝කܝٙഐ؈

  110. ซ޶ଡ଼ΥႧԊk $ gcc -S program.c ຬɓ...Ң݊Ⴍຬɓ...ຬɓЫซ޶ଡ଼Ⴇٙ༑ਢ....

  111. Ϟࣛࡉڢ͜ʔ̙... -I - include (header files) ٙฤర༩ࢰ -O - ௰Գʷ೻ܓ(0~2)

    -l - ࠅ link ٙ library -L - library ٙฤర༩ࢰ -W* - ᗫ׵ warning ٙ΢၇ண֛ પᑥԴ͜ -Wall !!
  112. ྅݊வᅵᇜᙇ....? g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB

    -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/ include -I. -o glwidget.o glwidget.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/ include -I. -o main.o main.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/ include -I. -o window.o window.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/ include -I. -o qtlogo.o qtlogo.cpp /usr/bin/moc-qt4 -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/ qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/include -I. glwidget.h -o moc_glwidget.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/ include -I. -o moc_glwidget.o moc_glwidget.cpp /usr/bin/moc-qt4 -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/ qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/include -I. window.h -o moc_window.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/ include -I. -o moc_window.o moc_window.cpp g++ -o hellogl glwidget.o main.o window.o qtlogo.o moc_glwidget.o moc_window.o -L/usr/lib -L/usr/X11R6/lib -lQtOpenGL - lQtGui -lQtCore -lGLU -lGL -lpthread ɓБɓБ͂kkk
  113. None
  114. Make? ᑋ׼eᜳݺeϞᅁ׌ ˙کeҞ஺eԣ˓ಞ

  115. .BLFGJMF

  116. Makefileٙਿ͉ࡡۆ # #ක᎘ٙڌ̴ͪ݊ൗ༆ targets: prerequisites recipe ... ɓࡈUBCοʩ } ஈଣ˙ό

    ͦᅺ ΋Ӕૢ΁
  117. ᔊఊٙMakefile # ɽ࢕λҢ݊ൗ༆ hw1: hw1.c gcc -o hw1 hw1.c echo

    “ᇜᙇҁϓ”
  118. εᏦᇜᙇ # ɽ࢕λҢ੽࡝࡝ఱ݊ൗ༆ə main.o: main.c gcc -c main.c a.o: a.c

    gcc -c a.c b.o: b.c gcc -c b.c hw1: main.o a.o b.o gcc -o hw1 main.o a.o b.o
  119. Դ͜ᜊᅰ CC = gcc main.o: main.c $(CC) -c main.c a.o:

    a.c $(CC) -c a.c b.o: b.c $(CC) -c b.c hw1: main.o a.o b.o $(CC) -o hw1 main.o a.o b.o
  120. ग़ॕٙୌ໮ - Іਗᜊᅰ CC = gcc %.o: %.c $(CC) -c

    $< hw1: main.o a.o b.o $(CC) -o $@ main.o a.o b.o ୋɓࡈprerequisite target pattern rule
  121. ഛ͜ᜊᅰ CC = gcc CFLAGS = -Wall -O2 OBJS =

    main.o a.o b.o EXEC = hw1 %.o: %.c $(CC) $(CFLAGS) -c $< $(EXEC): $(OBJS) $(CC) $(CFLAGS) -o $@ $(OBJS)
  122. ,FSPSP LFSPLFSPLFSPLFSPLFSP

  123. %FNPNP EFNPEFNPEFNPEFNP

  124. ੽ʦ˸ܝ.... $ make g++ -c -pipe -g -Wall -W -D_REENTRANT

    -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/ mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/ include/qt4 -I../shared -I/usr/X11R6/include -I. -o glwidget.o glwidget.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/ mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/ include/qt4 -I../shared -I/usr/X11R6/include -I. -o main.o main.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/ mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/ include/qt4 -I../shared -I/usr/X11R6/include -I. -o window.o window.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/ mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/ include/qt4 -I../shared -I/usr/X11R6/include -I. -o qtlogo.o qtlogo.cpp /usr/bin/moc-qt4 -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/ usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/ X11R6/include -I. glwidget.h -o moc_glwidget.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/ mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/ include/qt4 -I../shared -I/usr/X11R6/include -I. -o moc_glwidget.o moc_glwidget.cpp /usr/bin/moc-qt4 -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/ usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/ X11R6/include -I. window.h -o moc_window.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/ mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/ include/qt4 -I../shared -I/usr/X11R6/include -I. -o moc_window.o moc_window.cpp ... ... g++ -o hellogl glwidget.o main.o window.o qtlogo.o moc_glwidget.o moc_window.o -L/usr/lib -L/usr/X11R6/lib - lQtOpenGL -lQtGui -lQtCore -lGLU -lGL -lpthread $ _ ɓӉพ֛l
  125. (%# The GNU Debugger

  126. None
  127. Ы͜ཀ෗k

  128. %FCVHHFS̙˸฀ྒk

  129. %FCVH

  130. ͜QSJOUGேܣჿ%FCVHk

  131. Ιᜊᅰʫ࢙ Ιչѫ˖ο """ ### 

  132. Ιᜊᅰʫ࢙ Ιչѫ˖ο """ ###  ݟ޶ᜊᅰ ္છੂБݴ೻

  133. ৰϤʘ̮Ыᒔ̙˸.... ਗ࿒ࡌҷᜊᅰʫ࢙(ᗙ޶ᗙҷ) ਗ࿒ҷᜊੂБݴ೻(ᗙ޶ᗙҷ) ਈ಻ᜊᅰ஗ࡌҷٙ˜ԟࡈmoment™ Ҭ̈೻όᕸદٙ˜ԟࡈmoment™ ҪੂБʕٙ೻ό˜Ҵ™ཀԸdebug ᒔϞԟԬҢɰʔึٙ؇Г

  134. %FNP  4FHNFOUBUJPO 'BVMU াኳ᜗ਜݬ፹Ⴌ

  135. %FNP  ਗ࿒ࡌҷᜊᅰ࠽

  136. ੬ܸ͜˿ run - ක֐ੂБ೻ό break - ண֛ʕᓙᓃ continue - ᘱᚃੂБ

    until - ੂБՑत֛Зໄ next - ɨɓӉ step - ɨɓӉԨ৛ආՌό finish - ੂБՑՌόഐҼ backtrace - ޶call stack frame - ʲ౬frame up / down - ʲ౬frame print / display - ݟ޶ watch - ਈ಻ᅰ࠽ҷᜊ
  137. ʃҦ̷ ܸ˿ᐵᄳ gdb --tui <C-X> A commands - ࿁ʕᓙᓃІਗੂБܸ˿

  138. ʔࠅΎࣅQSJOUGԸEFCVHəl

  139. ܰৄf

  140. 7*. Vi IMproved

  141. None
  142. Ыᙂ੻ܣᅵٙᇜ፨ኜʑλ͜k

  143. None
  144. None
  145. None
  146. None
  147. None
  148. ޟЇ݊

  149. None
  150. None
  151. ࡱ

  152. None
  153. ӊϣ͂οேࠅ΋ܲ J ٙᇜ፨ኜ

  154. 7JNᗭ͜ϥə

  155. None
  156. ՇɽᎴᓃ

  157. කৎԸܘҞ

  158. ͜ৎԸܘҞ

  159. Ңɰฌ͜7JN ணࠇ࿁ͣ

  160. 'PS &YBNQMF

  161. мৰਞᅰ node *Merge(node *h1, node *h2){ node *h, *temp; h

    = temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ ದᅺίவ
  162. мৰਞᅰ node *Merge(node *h1, node *h2){ node *h, *temp; h

    = temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ →
  163. мৰਞᅰ node *Merge(node *h1, node *h2){ node *h, *temp; h

    = temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ →
  164. мৰਞᅰ node *Merge(node *h1, node *h2){ node *h, *temp; h

    = temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ →
  165. мৰਞᅰ node *Merge(node *h1, node *h2){ node *h, *temp; h

    = temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ →
  166. мৰਞᅰ node *Merge(node *h1, node *h2){ node *h, *temp; h

    = temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ →
  167. мৰਞᅰ node *Merge(node *h1, node *h2){ node *h, *temp; h

    = temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ Backspace
  168. мৰਞᅰ node *Merge(node *h1, node *h){ node *h, *temp; h

    = temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ Backspace
  169. мৰਞᅰ node *Merge(node *h1, node ){ node *h, *temp; h

    = temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ Backspace
  170. мৰਞᅰ node *Merge(node *h1, no){ node *h, *temp; h =

    temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ Backspace
  171. мৰਞᅰ node *Merge(node *h1){ node *h, *temp; h = temp

    = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ Backspace
  172. мৰਞᅰ node *Merge(nod){ node *h, *temp; h = temp =

    h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ Backspace
  173. мৰਞᅰ node *Merge(){ node *h, *temp; h = temp =

    h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ Backspace
  174. мৰਞᅰ In Vim node *Merge(node *h1, node *h2){ node *h,

    *temp; h = temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ ದᅺίவ
  175. мৰਞᅰ In Vim node *Merge(node *h1, node *h2){ node *h,

    *temp; h = temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ d i (
  176. мৰਞᅰ In Vim node *Merge(){ node *h, *temp; h =

    temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ ҁϓ
  177. ֻɨ୅5Б node *Merge(){ node *h, *temp; h = temp =

    h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ ದᅺίவ
  178. ֻɨ୅5Б node *Merge(){ node *h, *temp; h = temp =

    h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ ↓
  179. ֻɨ୅5Б node *Merge(){ node *h, *temp; h = temp =

    h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ ↓
  180. ֻɨ୅5Б node *Merge(){ node *h, *temp; h = temp =

    h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ ↓
  181. ֻɨ୅5Б node *Merge(){ node *h, *temp; h = temp =

    h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ ↓
  182. ֻɨ୅5Б node *Merge(){ node *h, *temp; h = temp =

    h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ ↓
  183. ֻɨ୅5Б node *Merge(){ node *h, *temp; h = temp =

    h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ ದᅺίவ
  184. ֻɨ୅5Б In Vim node *Merge(){ node *h, *temp; h =

    temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ ದᅺίவ
  185. ֻɨ୅5Б In Vim node *Merge(){ node *h, *temp; h =

    temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ 5 j
  186. ֻɨ୅5Б In Vim node *Merge(){ node *h, *temp; h =

    temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ ҁϓ
  187. мৰ”temp->next =” node *Merge(){ node *h, *temp; h = temp

    = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ ದᅺίவ
  188. мৰ”temp->next =” node *Merge(){ node *h, *temp; h = temp

    = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ Del
  189. мৰ”temp->next =” node *Merge(){ node *h, *temp; h = temp

    = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = p->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ Del
  190. мৰ”temp->next =” node *Merge(){ node *h, *temp; h = temp

    = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = ext = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ Del
  191. мৰ”temp->next =” node *Merge(){ node *h, *temp; h = temp

    = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ Del
  192. мৰ”temp->next =” node *Merge(){ node *h, *temp; h = temp

    = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = ->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ Del
  193. мৰ”temp->next =” node *Merge(){ node *h, *temp; h = temp

    = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = ->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ мཀ᎘ə
  194. мৰ”temp->next =” node *Merge(){ node *h, *temp; h = temp

    = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = 1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ Ctrl z
  195. мৰ”temp->next =” node *Merge(){ node *h, *temp; h = temp

    = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ Ctrl z
  196. мৰ”temp->next =” In Vim node *Merge(){ node *h, *temp; h

    = temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ ದᅺίவ
  197. мৰ”temp->next =” In Vim node *Merge(){ node *h, *temp; h

    = temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = temp->next = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ d f =
  198. мৰ”temp->next =” In Vim node *Merge(){ node *h, *temp; h

    = temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next) : (h2=h2->next); while(h1!=NULL && h2!=NULL){ temp = h1->data < h2->data ? h1 : h2; h1->data < h2->data ? (h1=h1->next):(h2=h2->next); } h2 == NULL ? (temp->next=h1) : (temp->next=h2); return h; } _ ҁϓ
  199. ኪ୦7JN

  200. ୋɓӉjԴ̴͜l

  201. ண֛Vim - .vimrc set number syntax on set autoindent set

    tabstop=4 set shiftwidth=4 set showcmd
  202. Vim୅ਗ (motion) hjkl - ʔ͜ߠd͜Ԓ᜗̘াl w, e, b and W,

    E, B 0, ^, $ f, F, t, T #G and gg
  203. ࠠል ٜટႭࠅࠠል఻ϣ!! Է 10j - Σɨ୅ਗ10Б 5yy - ልႡ5Б 30x

    - мৰ30ࡈοʩ yy5p - ልႡவБԨ൨ɪ5ϣ
  204. ࡌҷʫ࢙ d - delete (мৰא਒ɨ) y - yank (ልႡ) p

    - paste (൨ɪ) x, X - мৰοʩ r - replace (՟˾οʩ) u, <C-r> - Undo, Redo (ూࡡၾ՟ऊూࡡ)
  205. ፩ɝ˖ο i - insert a - append o - begin

    a new line c - change I, A, O, C
  206. ʃҦ̷jLFSPLFSPLFSPLFSPLFSP

  207. ฤరၾ՟˾ / - ֻۃฤర ? - ֻΫฤర *, # -

    ฤరఊο :%s/A/B/g - ҪהϞٙA՟˾ϓB ฤరᒔʔ̥வᅵ!!
  208. ʃҦ̷j[[ ၾ [FOUFS

  209. ʃҦ̷j7JNࣣᜀ NBSL

  210. ʃҦ̷j$/$1Іਗҁϓ

  211. ʃҦ̷jHH(

  212. ࠠࠅҦ̷ IFMQ TPNFUIJOH

  213. ࠠࠅᝈׂ ഒ࿁ʔࠅΌ௅ߠɨԸ

  214. Vim˖οي΁ Text Object ˖ο༧ي΁Ϟʡჿᗫڷk Operator + (i or a) +

    Region Indicator diw, daw - мৰɓࡈο(word) di{, da{ d2i{
  215. Νࣛᇜ፨εࡈᏦࣩ spilt vsplit tabpage tabnew tabe[dit] gt, gT, #gt

  216. Quickfix Window ࿁೻όක೯٫޴຅ྼ͜!! make grep copen, cclose cnext, cprevious

  217. ೻όᇁ࿡ᛌ(Folding) set foldmethod=syntax foldlevel=8 zc, zo, za

  218. ˖οᇜᇁਪᕚ Windowsɪٙʕ˖ᏦࣩࣅՑLinuxఱᜊ඾ᇁk set fileencodings=utf-8,big5 - Ꮶࣩᇜᇁ set encoding=utf-8 - ʫ௅ᇜᇁ

    set termencoding=utf-8 - ୞၌ዚᇜᇁ ӊБٙഐ҈Ϟ׉׉ٙ؇Гk set fileformats=unix,dos
  219. Іʉண֛Ҟઠᒟl Key Mapping map nmap imap vmap (ᒔϞйٙ)

  220. ̮ન೻ό(Plug-ins) Ϟ൴ॴ൴ॴεٙ Vim ̮ન̙˸͜ NERDTree Tagbar snipMate Completion: neocomplcache, OminCppComplete

    ......
  221. 7JNɰϞྡҖʧࠦ  (7JN

  222. 7JNܘλܘ੶ɽ ணࠇ࿁ͣ

  223. ഐႧ ̙˸ʔึ vimdШ݊ࠅܿࡈλٙ͜ᇜ፨ኜf ̙˸ʔᏑ gcc ༧ makedШ݊йᜫІʉᇜᙇՑଢ଼ϥf ̙˸ʔ͜ gdbdШ݊ࠅܿࡈ debugger

    Ը͜f ̙˸ʔ፯ gitdШ݊ɓ֛ࠅϞو͉છՓ˙ࣩf ኪ୦ᜊᑋ׼dʔࠅ˄рɢf
  224. THANK YOU FOR YOUR ATTENSION 3Q =) by CrBoy 2012.03...

  225. ͉ᔊజ͟ଭ͗ݰ (CrBoy) <crboy@crboy.net> ႡЪ ˸௴͜CC ֑Τᅺͪ-޴Ν˙όʱԮ 3.0 ̨ᝄ બᛆૢಛᙑ̈ ᛇڎ΂ОҖόʘࠠႡe౳бၾࡌҷdШሗ׼ᜑᅺൗЪ٫֑ΤeIDၾE-maildԨ˸޴Νબᛆૢಛਗ਼ࠃ͛Ъۜᙑ̈

    ᔊజʕהˏ͜ʘྡ˪ၾਠᅺ௅ʱᓘ՟Іၣყၣ༩dՉᛆлޫʱ᙮΢༈ʮ̡אഹЪɛהϞ