结构体定义 包括数据域和指针域。 struct Node { int data; Node* next; }; 创建链表 通过数组来创建带头节点的链表。 Node* create(int A[],int n) { //创建头指针、前驱指针 Node *head,*pre; head=new Node; head->next=NULL; pre=head; //循环新建节点 for(int i=0; i<n; i++) { Node* p = new Node;