# 链表基础

/*
* ===========================================================================
*
*    Description:
*        Version:  1.0
*        Created:  2018年04月15日 12时49分59秒
*       Revision:  none
*       Compiler:  gcc
*         Author:   (ycs),
*        Company:
*
* ===========================================================================
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct _node_ {
int data;
struct _node_ *next;//指针

//创建空链表头

}

//头插法插入链表

node->data = data;

return 0;
}
//尾插法插入链表

//遍历tail指针位置
while(NULL != tail->next) {
tail = tail->next;
}

node->data = data;
//新节点插入
tail->next = node;
node->next = NULL;

return 0;
}
//顺序插入链表

//遍历判断节点大小
while(NULL != p->next && data > p->next->data)
p = p->next;

node->data = data;
//新节点插入
node->next = p->next;
p->next = node;

return 0;
}
//删除特定节点

int i = 0;

while(p){//遍历链表
if(i == num -1 ){//找到节点
delNode = p->next;
p->next = delNode->next;//链表指针指向下一个链表节点
free(delNode);//删除
}
i ++;
p = p->next;
}
}
//添加特定位置节点
int i = 0;

while(p){//遍历链表
if(i == num -1 ){//找到位置
}

i ++;
p = p->next;
}

}

//逆序链表

while(NULL != curent){//curent和tmp的偏移
tmp = curent->next;
curent = tmp;
}
return 0;

}

while(NULL != p->next){
p = p->next;
printf("data : %d ",p->data);
}
printf("\n");
return 0;
}

int main(){
int i = 0;
for(i = 0;i < 10; i ++) {
}