#include <stdio.h>
#include <malloc.h>
struct LNode{
int data;
struct LNode *next;
};
struct LNode *create(int n){
struct LNode *head,*p1,*p2;
int i,a;
head=NULL;
printf("input integers:\n");
for(i=n;i>0;i--){
p1=(struct LNode*)malloc(sizeof(struct LNode));
scanf("%d",&a);
p1->data=a;
if(head==NULL){
head=p1;
p2=p1;
}else{
p2->next=p1;
p2=p1;
&n
c语言之单链表的创建和逆置
最新推荐文章于 2024-04-15 23:01:14 发布
本文详细讲解如何使用C语言创建单链表,并介绍一种常见的链表反转算法,帮助理解链表操作的基本原理。

最低0.47元/天 解锁文章
2250

被折叠的 条评论
为什么被折叠?



