????????????????
???????????? ???????[ 2015/8/3 10:10:39 ] ????????????? ??
????????????????????д???Щ???????????θ??????????????????д???????????????????????????????????????????????????????????????????????????????д???Щ??????Щ?????е??вο???????????????????????????????????????????????????????????а?????
????????
????????????????????????????????????????????????????С?
?????????????????????????????е??????????в??????????????????????????????????????????
?????????У???????????????????????????
??????????????????
????????
????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 = ¤t->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 = ¤t->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 = ¤t->next;
????}
????}
????}
????// ????? ???????????????????
????// ?βΣ? 1??????????????????????????????&head
????// 2??????????????????????next?????????&head->next
????void del_linkAll(Node ** plink){
????register Node * current;
????while((current = *plink) != NULL){
????//????????????????????????????????????????????????
????del_link(¤t->next??current->data);
????plink = ¤t->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???'
主站蜘蛛池模板:
日韩福利一区
|
国产成人h片视频在线观看
国产成人lu在线视频
|
亚洲国产二区三区久久
|
最近最新视频中文字幕4
|
黄色激情视频在线观看
|
成年视频网站免费观看
|
成人综合久久综合
|
免费一级毛片正在播放
|
日韩在线视精品在亚洲
|
久久精品网址
|
国产高清精品入口麻豆
|
日韩中文在线观看
|
欧美成人午夜做受视频
|
欧美日韩精品高清一区二区
|
免费看黄色的网址
|
日本在线观看中文字幕
|
日本欧美高清全视频
|
成人国产综合
|
一级a性色生活片久久毛片
一级a美女毛片
|
男女一进一出无遮挡黄
|
九九99靖品|
97欧美在线看欧美视频免费
|
日韩在线 | 中文
|
国产精品日产三级在线观看
|
色网站视频
|
波多野结衣一区二区三区
|
久热re这里只有精品视频
|
麻豆社区
|
免费aa视频
|
在线看你懂
|
视频黄色片|
欧美成人免费全部观看天天性色
|
成年视频xxxxxx在线
|
亚洲成a人片在线网站
|
在线亚洲+欧美+日本专区
|
精品国产v无码大片在线观看
|
好男人www社区资源在线观看
|
中文字幕第二页在线
|
日韩欧美在线观看成人
|
香蕉久久综合
|
精品视频免费播放
|