已知head为带头结点的单循环链表的头指针,链表中的数据元素依次为(a1,a2,a3,a4,…,an),A为指向空的顺序表的指针。阅读以下程序段,并回答问题:(1)写出执行下列程序段后的顺序表A中的数据元素;(2)简要叙述该程序段的功能。if(head->next!=head){p=head->next;A->length=0;while(p->next!=head){p=p->next;A->data[A->length++]=p->data;if(p->next!=head)p=p->next;}}

时间:2022-10-25 17:20:14 所属题库:数据结构题库

相似题目