多功能单链表实现
功能&指令 1.增加头节点 addHead + value 2.增加特定节点前的节点 addIndex + value + index 3.增加尾节点 addTail +value 4.删除头节点 deleteHead 5.删除特定节点前的节点 deleteIndex +index 6.翻转链表 reverse 7.打印链表 printList 8.清空链表 freeList 9.退出 EOF(Windows Ctrl+Z)(Linux/Unix Ctrl+D) 程序实现 # include <stdio.h> # include <stdlib.h> # include <string.h> typedef struct Node { int val ; struct Node * next ; } List ; List * creatList ( ) { List * head = ( List * ) malloc ( sizeof ( List ) ) ; head -> next = NULL ; return head ; } //Get the node by subscript, the subscript of the head node is 1 //If the node value is successfully obtained, the value