void createList(int Len, int *array)
{
 struct Node {
              int data;
              struct Node *next;
              };
 typedef struct Node LNode;
 typedef LNode *List; 
 List first = NULL; 

for(int i=0;i<len;i++) 
   {
    newnode = (List) malloc(sizeof(LNode));
    newnode->data = array[i];
    newnode->next = first;
    first = newnode;
   }

}




List SearchNode(int d)
{
 struct Node {
              int data;
              struct Node *next;
              };
 typedef struct Node LNode;
 typedef LNode *List; 
 
List first = NULL; 

List current = first;
while(current != NULL )
     {
      if ( current->data == d )
         return current;
      current = current->next;
     }
}


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 Joy 的頭像
    Joy

    正Man's World

    Joy 發表在 痞客邦 留言(0) 人氣()