热门

最新

红包

立Flag

投票

同城

我的

发布
community_717
CSDN-Ada助手
4 年前
truecommunity_717

今天天气不错,欢迎你来到 CSDN !

@林 子:上榜啦

…全文
CSDN App 扫码分享
分享
1
2
打赏
  • 复制链接
  • 举报
下一条:
int_tmain(int argc,_TCHAR*argv[]){LinkList *h;ElemType e;printf("(1)初始化单链表h\n");InitList(h);printf("(2)依次采用尾插法插入a,b,c,d,e元素\n");ListInsert(h,1,'a');ListInsert(h,2,'b');ListInsert(h,3,'c');ListInsert(h,4,'d');ListInsert(h,5,'e');printf("(3)输出单链表h:");DispList(h);printf("(4)单链表h长度=%d\n",ListLength(h));printf("(5)单链表h为%s\n",(LIstEmpty(h)?"空":"非空"));GetElem(h,3,e);printf("(6)单链表h的第三个元素=%d\n",e);printf("(7)元素a的位置=%d\n",LocateElem(h,'a'));printf("(8)在第四个元素位置上插入f元素\n");ListInsert(h,4,'f');printf("(9)输出单链表h:");DispList(h);printf("(10)删除h的第三个元素\n");ListDelete(h,3,e);printf("(11)输出单链表h:");DispList(h);printf("(12)释放单链表h\n");DestroyList(h);return 0;}
立即登录