正在加载图片...
(2) (3) 2.以下函数在head为头指针的具有头结点的单向链表中删除第i个结点。 struct node int data; struct node next; }; typedef struct node NODE int delete(NODE head,int i NODE*p,¥q; int j; q=head; j=0; while((g!=NULL)&.&.((1) { (2) j十+; if(q==NULL) return(0); p=(3) (4) free((5) return(1); 3 1358(2) (3) • , • , 2. 在head 指针 第i 结点 struct node { int data; struct node 铃next; typedef struct node NODE int delete(NODE 祷head,int i ) NODE 祷p 头q; n -] q=head; j=05 while( (q! =NULL) &.&.( (1) » (2) 十 十 ; if(q= =NULL) return(O) ; p=(3) (4) • , =p 一>next; free( (5) return (1 ) ; 1358
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有