#include <iostream>
using namespace std;
//定义一个链表结构体
struct node{
int value;
node* next;
};
//创建链表
node* CreateList(int array[],int n){
node *head=NULL,*tail=NULL;
for(int i=0;i<n;i++)
{
node* tmp=new node;
tmp->value=array[i];
tmp->next=NULL;
if (head==NULL){
head=tail=tmp;
}
[c++]链表(创建,添加,遍历,寻找)
最新推荐文章于 2022-06-09 16:36:42 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)