⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 snlist.cpp

📁 采用模版函数对数据结构的线性列表和栈以及队列进行编程。
💻 CPP
字号:
#include "List\NList.h"

void main()
{
//   SNode<char> *head;
//   DNode<char> *head;
   OList<char>  head;
//   CNode<char>   *head;
   SetNull(&head);
   Insert(&head,'a',1);
   Insert(&head,'b',2);
   Insert(&head,'a',2);   
   Insert(&head,'c',4);
   Insert(&head,'d',3);
   Insert(&head,'e',1);
   Insert(&head,'f',7);
   Display(&head);
   printf("Single List length=%d\n",Length(&head));
   printf("Position:%d   Value:%c\n",3,Get(&head,3));
   printf("Value: %c  Position:%d\n",'a',Locate(&head,'a'));
   printf("Delete the first node: ");
   Delete(&head,1);
   Display(&head);
   printf("Delete the fifth node: ");
   Delete(&head,5);
   Display(&head);
   printf("Delete the three nodes from the first node: ");
   Delete(&head,3);
   Delete(&head,2);
   Delete(&head,1);
   Display(&head);

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -