请求栈以及队列的算法实现源程序c
1.栈的顺序存储结构c 语言源程序
2.队列的链表存储结构c 语言源程序
thanks
问题点数:100、回复次数:2Top
1 楼hitcha2002(茜茜)回复于 2002-10-17 19:35:19 得分 100
void create(A,n)
vector a;
int n;
{int i;
for(i=0;i<n;i++)
scanf("%d",A[i]);
}
void creat()
{ node *head,*p,*s
int x,cycle=1;
head=(node*)malloc(sizeof(node));
p=head;
while(cycle)
{ scanf("%d",&x);
if(x!=0)
{s=(node*)malloc(sizeof(node));
s->data=x;
p->next=s;
p=s;
}
else cycle=0;
}
p->next=NULL;
p=head;
head=head->next;
free(p);
}Top
2 楼he_zhidan(何志丹:www.dzlishi.net,www.vcshare.net)回复于 2002-10-18 09:39:01 得分 0
如:int a[100],i;
struct data
{int x;
struct data *next;
}Top




