2020数据结构之链表.pptVIP

  • 1
  • 0
  • 约6.96千字
  • 约 40页
  • 2020-12-09 发布于天津
  • 举报
2.1.2 单链表 list-head a 1 a i-1 a i a n new new_node-next = a1; list-head; node list-head = new_node; SCIE, University of Electronic Science and T echnolog y of China 21 2.1.2 单链表 void insertl ( list, new_node , location ){ if(location == 1){ new_node = list-head; 边界情况: } list-head = new_node; 表首插入 表尾插入 else{ counter = 1; while( counter i -1 p != NULL){ p = list-head; 初始化 counter = counter + 1; p = p-next; } new_node-next = p-next; } p-next = new_node; } list-length ++; SCIE, University of Electronic Science and Technology of China 22 2.1.2 单链表 list-head 表尾插入 a 1 当 i 链表长度 时 a i-1 a i p a n

文档评论(0)

1亿VIP精品文档

相关文档