标签:style blog io color sp div log bs ef
1、单链表插入
#include <stdio.h> #include <stdlib.h> #define FALSE 0 #define TRUE 1 typedef struct NODE{ STRUCT NODE *link; int value; }Node; int sll_insert(Node *current,int newvalue) { Node *previous; Node *new; while(current->value<newvalue){ previous =current; current =current->link; } new =(Node *)malloc(sizeof(Node)); if( new == NULL) return FALSE; new->value=newvalue; new->link = current; previous ->link=new; return TRUE; } int main() { int result; result=sll_insert(root,12); return 0; }
待测--未调通
标签:style blog io color sp div log bs ef
原文地址:http://www.cnblogs.com/bluewelkin/p/4063094.html