pNode CreateList();//创建链表函数 voidTraverseList(pNode );//遍历链表函数 boolInsert_Node(pNode ,int,int);//链表节点插入函数,第一个参数是头节点,第二个参数是要在第几个节点前插入,第三个参数是要插入的数据 intDel_Node(pNode,int);//删除链表节点,第一个参数是头节点,第二个参数是删除第几...
DLNode*InitList(DLNode *DL);//初始化intListEmpty(DLNode *DL);//判空intListLength(DLNode *DL);//返回链表长度intListInsert(DLNode *DL,inti, ElemType e);//插入元素intListDelete(DLNode *DL,inti);//删除第i个元素voidTraverseList(DLNode *DL);//遍历线性表//初始化DLNode* InitList(DLNod...
1.掌握单链表的基本操作:插入、删除、查找以及表的合并等运算。 2.掌握运用C语言上机调试单链表的基本方法。 二、实验任务 1.试编写在单链表上实现插入和删除的算法。 三、程序流程图 四、测试过程及结果 五、总结 1.程序特点:最小化、模块化、for循环。 3.单链表特点:动态分配内存、必须从已知指针逐一查找数...
include <stdio.h> include <malloc.h> define N 8 typedef struct node {int data;struct node *next;}node;node * createsl(){ node *p,*s,*h;int j=1,x;p=s=h=(node*)malloc(sizeof(node));h->next=NULL;printf("please input the data to create the list,end with -1 or ...
C++有,c的没有,不过可以自己改回去。include<iostream> using namespace std;int len=0;struct list//结构的声明 { int data;list *next;};list *head;list *create()//建立链表,这是第一步;{ list *p,*q;head=NULL;int temp;cout<<"Now create the list,Input the data,end by -1...
(1) 链表初始化和创建 (2) 在链表的第i个位置插入数据data (3) 删除链表中的第i个节点 (4) 删除所有元素 (5) 最后的修改 5、优先队列(堆)测试 5.1++i和i++运算符的测试m41 5.2优先队列上滤插入和下滤删除 5.3 C语言实现最小堆和堆排序