试题详情
简答题设线性链表的存储结构如下: 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 ; } }
  • NULL
  • 关注下方微信公众号,在线模考后查看

热门试题