????????????????????д???Щ???????????θ??????????????????д???????????????????????????????????????????????????????????????????????????????д???Щ??????Щ?????е??вο???????????????????????????????????????????????????????????а?????
????????
????????????????????????????????????????????????????С?
?????????????????????????????е??????????в??????????????????????????????????????????
?????????У???????????????????????????
??????????????????
????????
????typedef struct NODE{
????struct NODE * link;
????int value;
????} Node;
??????????????
??????????????
????Node * create(){
????Node * head??* p??* tail;
????//  ???????????????????
????head=NULL;
????do
????{
????p=(Node*)malloc(LEN);
????scanf("%ld"??&p->value);
????if(p->value ==0) break;
????//  ????β???
????if(head==NULL)
????head=p;
????else
????tail->link=p;
????tail=p;
????}
????while(1);
????tail->link=NULL;
????return head;
????}
????int delet(Node **linkp??int del_value){
????register Node * current;
????Node * m_del;
????//???????????λ??????????????????????????????????
????while((current = *linkp)!=NULL  &&  current->value != del_value)
????{   
????linkp = &current->link;
????}
????if(NULL==current)
????return FALSE;
????else
????{
????//??y???????????TRUE
????m_del=current->link;
????free(current);
????*linkp=m_del;
????}
????return TRUE;
????}
????//????β??????????????????????
????int insert(Node **linkp??int new_value){
????register Node * current;
????Node * m_new;
????//???????????λ????????????????????????????????????????2????????
????while((current = *linkp)!=NULL  &&  current->value < new_value)
????{   
????linkp = &current->link;
????}
????//??????????棬????????浽?????У????????????????FALSE
????m_new =(Node*)malloc(LEN);
????if(NULL==m_new)
????return FALSE;
????m_new->value = new_value;
????//??????????????????TRUE
????m_new->link = current;
????*linkp=m_new;
????return TRUE;
????}
??????????????β??????????????????????????????tail->link=head;???е??????????????????????????????????????????????????????
????Node * reverse(Node * head){
????Node * p??*q;
????q= head;
????p = head->link;
????head = NULL;
????while(p)
????{   
????//  ??????????????
????q->link = head;
????head  = q;
????//  ?????????????????
????q = p;
????p = p->link;
????}
????q->link = head;
????head  = q;
????return  head;
????}
???????????????????x???????????????????????
????//    ?????    ???????????????x????
????//    ?βΣ?    1??????????????????????????????&head
????//            2??????????????????????next?????????&head->next
????//    ?βΣ?    ?????????????????????
????void del_link(Node ** plink??int x){
????register Node * current;
????while((current = *plink)!=NULL)
????{
????// ????????????x?????
????while(current && current->data == x){
????//  ???????????????????
????Node * temp = current;
????* plink = current = current->next;
????//  ?????????
????free(temp);
????}
????//???±???????
????if (current)
????{
????plink = &current->next;
????}
????}
????}
????//    ?????    ???????????????????
????//    ?βΣ?    1??????????????????????????????&head
????//            2??????????????????????next?????????&head->next
????void del_linkAll(Node ** plink){
????register Node * current;
????while((current = *plink) != NULL){
????//????????????????????????????????????????????????
????del_link(&current->next??current->data);
????plink = &current->next;
????}
????}
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????#ifndef __LINKLISTEX_H__
????#define __LINKLISTEX_H__
????#include <string>
????using std::string;
????//================???????????===============
????template<class T>
????class DulLinkList
????{
????private:
????typedef struct DulNode{
????struct DulNode * prior;
????T    data;
????struct DulNode * next;
????}DulNode;
????DulNode * frist;
????void Init();
????void Del(DulNode * delNode);
????public:
????DulLinkList();
????~DulLinkList();
????void AddElem(const T &  data);
????void DelElem(const T & data);
????string ToString()const;
????protected:
????};
????#endif//__LINKLISTEX_H__
????????????????????????????
????#include "LinkListEx.h"
????#include <iostream>
????using namespace  std;
????template<class T>
????DulLinkList<T>::DulLinkList(){
????Init();
????}
????template<class T>
????void DulLinkList<T>::Init(){
????// ?????????????
????this->frist = new DulNode;
????this->frist->prior = NULL;
????this->frist->next = NULL;
????}
????template<class T>
????void DulLinkList<T>::AddElem(const T & data){
????// ????????????
????DulNode * newNode = new DulNode;
????newNode->data = data;
????newNode->next = this->frist;
????newNode->prior = NULL;
????this->frist->prior = newNode;
????this->frist = newNode;
????}
????template<class T>
????void DulLinkList<T>::DelElem(const T & data){
????DulNode * current = this->frist->next;
????while (current  != NULL  && current->data != data) {
????current = current->next;
????}
????if (!current)
????{
????return;
????}
????Del(current);
????}
????template<class T>
????void DulLinkList<T>::Del(DulNode * delNode){
????// ?????????????????????
????delNode->prior->next = delNode->next;
????delNode->next->prior = delNode->prior;
????delete delNode;
????}
????template<class T>
????DulLinkList<T>::~DulLinkList(){
????DulNode * current = this->frist;
????while (current)
????{
????DulNode * old = current;
????current = current->next;
????delete old;
????}
????}
????template<class T>
????string DulLinkList<T>::ToString()const{
????string res;
????DulNode * current = this->frist->next;
????while (current)
????{
????res.append(1??current->data);
????current = current->next;
????}
????return res;
????}
????????????????????????????Щ??????????????????????????????????????????????飩??????????????????????????????
??????????к??????????????????????????????????????????????磬?????????????????????????????????????????ù????????????????????????????????????????
??????????????
?????????????web????????????????????????????????????????????????????????????????????????
?????????????????????????????????????????
????// ????????????
????int str_len(char *str){
????return *str ? str_len(str+1)+1 : 0 ;
????}
????// ?????????
????void str_cpy(char *str1??char *str2){
????while(*str1++ = *str2++); //??str2???'