struct Node{
int val;
Nodenext;
Node():next(NULL){}
Node(int _val):val(_val),next(NULL){}
};
void print(Nodehead){
for(auto p=head;p;p=p->next)
cout<[HTML_REMOVED]val<<’ ‘;
cout<[HTML_REMOVED]nexxt=a;
print(head);
auto b=new Node(3);
a->next=b;
auto new Node(4);
c->next=a;
head->next=c;
auto p=head;
head=head->next;
print(head);
Node *head=new Node(),tail=new Node();
head->next=tail,tail->prev=head;
auto a=new Node(1);
a->next=head->next;
a->prev=head;
head->next->prev=a,head->next=a;
auto b=new Node(2);
b->next=a->next;
b->prev=a;
a->next->prev=b;
a->next=b;
//双链表的删除操作
b->prev->next=b->nenxt;
b->next->prev=b->prev;
return 0;
}