기본 콘텐츠로 건너뛰기

4월, 2018의 게시물 표시

simpleLinkedList-ascending int list (ex2)

#include <stdio.h> #include <stdlib.h> #include <limits.h> #define FALSE 0 #define TRUE 1 typedef int element; typedef struct ListNode {     element data;     struct ListNode *link; } ListNode; typedef struct {     ListNode *head;     // 헤드 포인터     int length;     // 노드의 개수 } ListType; // phead: 리스트의 헤드 포인터의 포인터 // p : 선행 노드 // new_node : 삽입될 노드 void error(char *message) {     fprintf(stderr,"%s\n",message);     exit(1); } void insert_node(ListNode **phead, ListNode *p,                     ListNode *new_node)                     //giving way to change headNode itself // previous node to manipulate likes //new data node to insert in the list //to give **phead, new node should know {     if( *phead == NULL ){   // 공백리스트인 경우         new_node->link = NULL;         *phead = new_node;     }     else if( p == NULL ){ // if previous node input value is null, means that new node is supposed to be head of the

week5class2 simpleConnectedList

#include <stdio.h> #include <stdlib.h> typedef int element; typedef struct ListNode { element data; struct ListNode *link;//다른 노드의 주소를 저장하는 포인터변수 }ListNode; void insertNode(ListNode **phead, ListNode *p, ListNode* newNode) { if(*phead == NULL) { newNode->link = NULL;//there is only one node, new node *phead = newNode;//first head is new head } else if(p == NULL)//newNode do not want to be second => it won't have previous node { newNode->link = *phead;//original first node will follow new node *phead = newNode; } else { newNode->link = p->link;//the node which was following pnode will follow newNode p->link = newNode; } } void removeNode(ListNode **phead, ListNode*p, ListNode *removed) { if(p == NULL)//no presending node for removed = removed is first node { *phead = (*phead)->link;//following node of removed will be first node } else { p->link = removed->link; free(

week2reviewPageContent

<!DOCTYPE HTML> <html lang = "kr"> <title>PageContents of Min</title> <header><h1>Here for header</h1></header>   <nav>     <ul>       <li>nav1</li>       <li>nav2</li>       <li><a href="#footer">go to footer</a></li>     </ul>   </nav> <section>     <header>         <h2>Here for section</h2>         <h3>hgroup is dead tag!!</h3>     </header>   <p>Section tag cannot be child element of bodytag and needs header.<br>   Refer the picture below for more infos.<br>   <img src = "pageContents.jpg" alt ="A picture of pageContents"   title = "what's ya looking at!" height = "310" width = "252"><br>   <a href="week2review.html" target = blank>go to my homepage </a></p> </section

week2review

<!DOCTYPE HTML> <html lang = "kr"> <meta charset = "UTF-8">   <title>Min's homePage</title>   <body>   <h1>Welcome to my homepage!!</h1>     <p>page content goes here!!</p>     <ol>         <li>what I like       <ul>         <li>Chocochip cookies</li>         <li>Tall and mustle</li>         <li>Drinking with friends</li>         <li>Chilling down and netflix</li>         <li>Espresso in calm cafe</li>       </ul>       </li>     </ol>     <img src = "space.jpg" alt = "A photo of space">     <dl><!--dl is a description list-->       <dt>SPACE</dt><!--dt is a name or label-->       <dd>one more thing I like. I loved getting to know things    about the universe and the stars since when I was little</dd>    <!--dd is a