多做题,通过考试没问题!

02331数据结构

题库首页>高等教育工学类自考>02331数据结构

设线性链表的存储结构如下: struct node {ELEMTP data; /*数据域*/ struct node *next; /*指针域*/ } 试完成下列建立单链表的算法。 creat() {char var; head=(struct node *)malloc(sizeof(struct node)); head->next= () ; while((var=getchar())!=‘/n’){ ptr=( struct node *)malloc(sizeof(struct node)); ptr->data= var ;ptr->next=head->next; head->next= ptr ; } }

查看答案

微信扫一扫手机做题