0000gsln
幼苗
共回答了17个问题采纳率:82.4% 举报
struct st
{
int data;
struct st *next;
};
struct st *insenode(struct st *head,int x)
{
struct st *new,*last,*current;
new =(struct st *)malloc(sizeof(struct st));
new->data=x;
current=head;
while(x>current->data && current->data!=null)
{
last=current;
current=current->next;
}
if(xdata)
{
if(current==head)
{
new->next=head;
head=new;
}
else
{
new->next=current;
last->next=new;
}
}
else
{
new->next=null;
current->next=new;
}
return(new);
}
不懂的地方再问我
1年前
4