单链表的基本操作
以下代码参考晴神宝典#include#includeusing namespace std;struct node{int data;node* next;};node* create(int a[],int n){node* pre,p,head;head=new node;head->next=NULL;pre=head;for(int i=0;i<n;i++){p=new node;p->data=a[i];p->next=NULL;pre
原创
2020-06-09 11:43:16 ·
71 阅读 ·
0 评论