摘要:
1、单链表逆置View Code 1 //1.单链表逆置 2 template<class Type> void LinkList<Type>::Reverse() 3 { 4 if(Head->Next==NULL) 5 { 6 cout<<"链表为空!"<<endl; 7 return; 8 } 9 Node *cur=Head->Next;10 Node *temp=cur->Next;11 if(NULL==cur || NULL==temp)12 {13 return;14 ... 阅读全文
摘要:
LinkList类View Code 1 //LinkList类 2 template<class Type>class LinkList 3 { 4 private: 5 struct Node 6 { 7 Node *Next; 8 Type data; 9 }*Head,*Tail;10 unsigned int size;11 public:12 LinkList()13 { 14 Head=new Node;15 Head->Next=NULL; 16 ... 阅读全文