1. List using:
The doubly linked list of data structures generally corresponds to the list in the STL, and List provides almost all the methods for double-linked list operations
Common list operations are (at least I use):
Remove
Push_back,
</pre><pre name= "code" class= "CPP" > #include <iostream> #include <list>using namespace std; struct Node{int key;int val;}; void Main () {node * nn;list<node*> ll;for (int i=0; i<5; i++) {node * tmp=new node;tmp->key=i;ll.push_back (TMP) ; if (i==3) nn=tmp;} Ll.remove (NN); List<node*>::iterator it;cout<< "All the data in the list is:" <<endl;for (It=ll.begin () ; It!=ll.end (); it++) {cout<< (*it)->key<<endl;} cout<<endl<< "After delete the node the original pointer's space is still exist" <<endl;cout<<nn-& gt;key<<endl<<endl;cout<< "ll ' s size is:" <<ll.size () <<endl;}
Operation Result:
Use of STL controls