亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tree.hh

?? 一個德國人Kasper Peeters用C++ template寫的tree的STL實現(xiàn)
?? HH
?? 第 1 頁 / 共 5 頁
字號:
      template<class StrictWeakOrdering>      class compare_nodes {         public:            compare_nodes(StrictWeakOrdering comp) : comp_(comp) {};                        bool operator()(const tree_node *a, const tree_node *b)                {               static StrictWeakOrdering comp;               return comp(a->data, b->data);               }         private:            StrictWeakOrdering comp_;      };};//template <class T, class tree_node_allocator>//class iterator_base_less {// public://    bool operator()(const typename tree<T, tree_node_allocator>::iterator_base& one,//                  const typename tree<T, tree_node_allocator>::iterator_base& two) const//       {//       txtout << "operatorclass<" << one.node < two.node << std::endl;//       return one.node < two.node;//       }//};// template <class T, class tree_node_allocator>// bool operator<(const typename tree<T, tree_node_allocator>::iterator& one,//                const typename tree<T, tree_node_allocator>::iterator& two)//    {//    txtout << "operator< " << one.node < two.node << std::endl;//    if(one.node < two.node) return true;//    return false;//    }// // template <class T, class tree_node_allocator>// bool operator==(const typename tree<T, tree_node_allocator>::iterator& one,//                const typename tree<T, tree_node_allocator>::iterator& two)//    {//    txtout << "operator== " << one.node == two.node << std::endl;//    if(one.node == two.node) return true;//    return false;//    }// // template <class T, class tree_node_allocator>// bool operator>(const typename tree<T, tree_node_allocator>::iterator_base& one,//                const typename tree<T, tree_node_allocator>::iterator_base& two)//    {//    txtout << "operator> " << one.node < two.node << std::endl;//    if(one.node > two.node) return true;//    return false;//    }// Treetemplate <class T, class tree_node_allocator>tree<T, tree_node_allocator>::tree()    {   head_initialise_();   }template <class T, class tree_node_allocator>tree<T, tree_node_allocator>::tree(const T& x)    {   head_initialise_();   set_head(x);   }template <class T, class tree_node_allocator>tree<T, tree_node_allocator>::tree(const iterator_base& other)   {   head_initialise_();   set_head((*other));   replace(begin(), other);   }template <class T, class tree_node_allocator>tree<T, tree_node_allocator>::~tree()   {   clear();   alloc_.deallocate(head,1);   alloc_.deallocate(feet,1);   }template <class T, class tree_node_allocator>void tree<T, tree_node_allocator>::head_initialise_()    {    head = alloc_.allocate(1,0); // MSVC does not have default second argument    feet = alloc_.allocate(1,0);   head->parent=0;   head->first_child=0;   head->last_child=0;   head->prev_sibling=0; //head;   head->next_sibling=feet; //head;   feet->parent=0;   feet->first_child=0;   feet->last_child=0;   feet->prev_sibling=head;   feet->next_sibling=0;   }template <class T, class tree_node_allocator>void tree<T, tree_node_allocator>::operator=(const tree<T, tree_node_allocator>& other)   {   copy_(other);   }template <class T, class tree_node_allocator>tree<T, tree_node_allocator>::tree(const tree<T, tree_node_allocator>& other)   {   head_initialise_();   copy_(other);   }template <class T, class tree_node_allocator>void tree<T, tree_node_allocator>::copy_(const tree<T, tree_node_allocator>& other)    {   clear();   pre_order_iterator it=other.begin(), to=begin();   while(it!=other.end()) {      to=insert(to, (*it));      it.skip_children();      ++it;      }   to=begin();   it=other.begin();   while(it!=other.end()) {      to=replace(to, it);      to.skip_children();      it.skip_children();      ++to;      ++it;      }   }template <class T, class tree_node_allocator>void tree<T, tree_node_allocator>::clear()   {   if(head)      while(head->next_sibling!=feet)         erase(pre_order_iterator(head->next_sibling));   }template<class T, class tree_node_allocator> void tree<T, tree_node_allocator>::erase_children(const iterator_base& it)   {   tree_node *cur=it.node->first_child;   tree_node *prev=0;   while(cur!=0) {      prev=cur;      cur=cur->next_sibling;      erase_children(pre_order_iterator(prev));      kp::destructor(&prev->data);      alloc_.deallocate(prev,1);      }   it.node->first_child=0;   it.node->last_child=0;   }template<class T, class tree_node_allocator> template<class iter>iter tree<T, tree_node_allocator>::erase(iter it)   {   tree_node *cur=it.node;   assert(cur!=head);   iter ret=it;   ret.skip_children();   ++ret;   erase_children(it);   if(cur->prev_sibling==0) {      cur->parent->first_child=cur->next_sibling;      }   else {      cur->prev_sibling->next_sibling=cur->next_sibling;      }   if(cur->next_sibling==0) {      cur->parent->last_child=cur->prev_sibling;      }   else {      cur->next_sibling->prev_sibling=cur->prev_sibling;      }   kp::destructor(&cur->data);   alloc_.deallocate(cur,1);   return ret;   }template <class T, class tree_node_allocator>typename tree<T, tree_node_allocator>::pre_order_iterator tree<T, tree_node_allocator>::begin() const   {   return pre_order_iterator(head->next_sibling);   }template <class T, class tree_node_allocator>typename tree<T, tree_node_allocator>::pre_order_iterator tree<T, tree_node_allocator>::end() const   {   return pre_order_iterator(feet);   }template <class T, class tree_node_allocator>typename tree<T, tree_node_allocator>::breadth_first_queued_iterator tree<T, tree_node_allocator>::begin_breadth_first() const   {   return breadth_first_queued_iterator(head->next_sibling);   }template <class T, class tree_node_allocator>typename tree<T, tree_node_allocator>::breadth_first_queued_iterator tree<T, tree_node_allocator>::end_breadth_first() const   {   return breadth_first_queued_iterator();   }template <class T, class tree_node_allocator>typename tree<T, tree_node_allocator>::post_order_iterator tree<T, tree_node_allocator>::begin_post() const   {   tree_node *tmp=head->next_sibling;   if(tmp!=feet) {      while(tmp->first_child)         tmp=tmp->first_child;      }   return post_order_iterator(tmp);   }template <class T, class tree_node_allocator>typename tree<T, tree_node_allocator>::post_order_iterator tree<T, tree_node_allocator>::end_post() const   {   return post_order_iterator(feet);   }template <class T, class tree_node_allocator>typename tree<T, tree_node_allocator>::fixed_depth_iterator tree<T, tree_node_allocator>::begin_fixed(const iterator_base& pos, unsigned int dp) const   {   tree_node *tmp=pos.node;   unsigned int curdepth=0;   while(curdepth<dp) { // go down one level      while(tmp->first_child==0) {         tmp=tmp->next_sibling;         if(tmp==0)            throw std::range_error("tree: begin_fixed out of range");         }      tmp=tmp->first_child;      ++curdepth;      }   return tmp;   }template <class T, class tree_node_allocator>typename tree<T, tree_node_allocator>::fixed_depth_iterator tree<T, tree_node_allocator>::end_fixed(const iterator_base& pos, unsigned int dp) const   {   assert(1==0); // FIXME: not correct yet   tree_node *tmp=pos.node;   unsigned int curdepth=1;   while(curdepth<dp) { // go down one level      while(tmp->first_child==0) {         tmp=tmp->next_sibling;         if(tmp==0)            throw std::range_error("tree: end_fixed out of range");         }      tmp=tmp->first_child;      ++curdepth;      }   return tmp;   }template <class T, class tree_node_allocator>typename tree<T, tree_node_allocator>::sibling_iterator tree<T, tree_node_allocator>::begin(const iterator_base& pos) const   {   assert(pos.node!=0);   if(pos.node->first_child==0) {      return end(pos);      }   return pos.node->first_child;   }template <class T, class tree_node_allocator>typename tree<T, tree_node_allocator>::sibling_iterator tree<T, tree_node_allocator>::end(const iterator_base& pos) const   {   sibling_iterator ret(0);   ret.parent_=pos.node;   return ret;   }template <class T, class tree_node_allocator>template <typename iter>iter tree<T, tree_node_allocator>::parent(iter position) const   {   assert(position.node!=0);   return iter(position.node->parent);   }template <class T, class tree_node_allocator>template <typename iter>iter tree<T, tree_node_allocator>::previous_sibling(iter position) const   {   assert(position.node!=0);   iter ret(position);   ret.node=position.node->prev_sibling;   return ret;   }template <class T, class tree_node_allocator>template <typename iter>iter tree<T, tree_node_allocator>::next_sibling(iter position) const   {   assert(position.node!=0);   iter ret(position);   ret.node=position.node->next_sibling;   return ret;   }template <class T, class tree_node_allocator>template <typename iter>iter tree<T, tree_node_allocator>::next_at_same_depth(iter position) const   {   assert(position.node!=0);   iter ret(position);   if(position.node->next_sibling) {      ret.node=position.node->next_sibling;      }   else {       int relative_depth=0;      upper:      do {         ret.node=ret.node->parent;         if(ret.node==0) return ret;         --relative_depth;         } while(ret.node->next_sibling==0);      lower:      ret.node=ret.node->next_sibling;      while(ret.node->first_child==0) {         if(ret.node->next_sibling==0)            goto upper;         ret.node=ret.node->next_sibling;         if(ret.node==0) return ret;         }      while(relative_depth<0 && ret.node->first_child!=0) {         ret.node=ret.node->first_child;         ++relative_depth;         }      if(relative_depth<0) {         if(ret.node->next_sibling==0) goto upper;         else                          goto lower;         }      }   return ret;   }template <class T, class tree_node_allocator>template <typename iter>iter tree<T, tree_node_allocator>::append_child(iter position)   {   assert(position.node!=head);   assert(position.node);   tree_node* tmp = alloc_.allocate(1,0);   kp::constructor(&tmp->data);   tmp->first_child=0;   tmp->last_child=0;   tmp->parent=position.node;   if(position.node->last_child!=0) {      position.node->last_child->next_sibling=tmp;      }   else {      position.node->first_child=tmp;      }   tmp->prev_sibling=position.node->last_child;   position.node->last_child=tmp;   tmp->next_sibling=0;   return tmp;   }template <class T, class tree_node_allocator>template <class iter>iter tree<T, tree_node_allocator>::append_child(iter position, const T& x)   {   // If your program fails here you probably used 'append_child' to add the top   // node to an empty tree. From version 1.45 the top element should be added   // using 'insert'. See the documentation for further information, and sorry about   // the API change.   assert(position.node!=head);   assert(position.node);   tree_node* tmp = alloc_.allocate(1,0);   kp::constructor(&tmp->data, x);   tmp->first_child=0;   tmp->last_child=0;   tmp->parent=position.node;   if(position.node->last_child!=0) {      position.node->last_child->next_sibling=tmp;      }   else {      position.node->first_child=tmp;      }   tmp->prev_sibling=position.node->last_child;   position.node->last_child=tmp;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久草av在线| 亚洲永久精品大片| 色又黄又爽网站www久久| 日本欧美一区二区三区| 综合自拍亚洲综合图不卡区| 2020日本不卡一区二区视频| 国产精品123| 亚洲综合视频在线| 欧美日韩亚洲不卡| 久久精品国产精品亚洲红杏| 天堂av在线一区| 在线视频一区二区三| av资源网一区| 九九视频精品免费| 91官网在线观看| 久久久久久久久免费| 久久久综合九色合综国产精品| 日韩欧美国产一区在线观看| 一区二区在线免费| a在线播放不卡| 久久久另类综合| 国内精品国产成人| 欧美一区二区三区婷婷月色| 一区二区三区**美女毛片| 国产高清无密码一区二区三区| 久久99精品国产麻豆不卡| 欧美日韩在线三级| 亚洲综合免费观看高清完整版| 一区二区三区四区不卡视频 | 亚洲激情图片一区| 国产精品中文字幕一区二区三区| 国产91精品在线观看| 欧美第一区第二区| 久久国产视频网| 欧美日韩免费一区二区三区视频| 欧美一级一区二区| 国产视频在线观看一区二区三区| 亚洲欧美偷拍另类a∨色屁股| 一区二区久久久久久| 色婷婷综合久久久久中文一区二区 | 亚洲国产精华液网站w| 亚洲人快播电影网| 91欧美一区二区| 中文字幕字幕中文在线中不卡视频| 图片区小说区区亚洲影院| 精品婷婷伊人一区三区三| 婷婷综合另类小说色区| 91精品国产欧美日韩| 日本91福利区| 欧美tickling挠脚心丨vk| 国产在线精品一区二区夜色| 久久久久综合网| 9色porny自拍视频一区二区| 亚洲人成小说网站色在线| 精品视频999| 久久99精品国产麻豆不卡| 欧洲亚洲精品在线| 国产精品久久久久一区| 91久久香蕉国产日韩欧美9色| 国产午夜精品久久| 91原创在线视频| 亚洲主播在线播放| 99在线精品免费| 亚洲午夜电影在线| 精品日韩在线观看| 99国产精品国产精品久久| 精品国产一区二区三区久久久蜜月| 国产精品久久久久久久久晋中 | 日韩欧美精品在线视频| 国产精品小仙女| 樱桃视频在线观看一区| 日韩小视频在线观看专区| 狠狠色丁香九九婷婷综合五月| 欧美丝袜丝交足nylons图片| 老司机免费视频一区二区三区| 91丨九色丨黑人外教| 婷婷夜色潮精品综合在线| 欧美亚洲自拍偷拍| 国产一区二区三区电影在线观看| 欧美一级夜夜爽| 成人av第一页| 日本vs亚洲vs韩国一区三区二区| 欧美日韩高清不卡| 国产成人精品免费一区二区| 午夜欧美大尺度福利影院在线看| 在线精品视频一区二区三四| 最近日韩中文字幕| 久久一区二区三区四区| 国产一区二区三区在线观看免费| 日韩欧美黄色影院| 欧洲国内综合视频| 99久久久免费精品国产一区二区| 国产欧美日韩一区二区三区在线观看 | av福利精品导航| 免费精品视频在线| 亚洲国产视频a| 国产欧美综合在线| 欧美xxxxx牲另类人与| 欧美少妇bbb| 91毛片在线观看| 国产91精品露脸国语对白| 蜜桃免费网站一区二区三区| 夜夜夜精品看看| 亚洲婷婷综合色高清在线| 色婷婷综合激情| 丁香网亚洲国际| 一区二区三区小说| 884aa四虎影成人精品一区| 日韩精品视频网| 亚洲一区日韩精品中文字幕| 亚洲你懂的在线视频| 国产亚洲欧美色| 国产午夜亚洲精品理论片色戒| www.日韩在线| 国产精品18久久久| 国产精品伊人色| 久久99久久99小草精品免视看| 国产午夜精品久久久久久久| 26uuu国产电影一区二区| 日韩欧美国产精品| 欧美大片国产精品| 精品久久一区二区三区| 久久人人爽爽爽人久久久| 精品久久人人做人人爰| 久久亚洲综合色| 久久久久99精品国产片| 国产丝袜在线精品| 中文在线资源观看网站视频免费不卡| 欧美日韩综合色| 欧美色网站导航| 制服丝袜国产精品| 欧美不卡一区二区三区四区| 色婷婷久久一区二区三区麻豆| 久久aⅴ国产欧美74aaa| 韩国毛片一区二区三区| 亚洲国产日韩av| 日韩高清不卡在线| 国产在线精品一区二区夜色 | 午夜精品久久久久| 日韩一区欧美二区| 精品无码三级在线观看视频| 国产成人精品影院| 日韩电影在线免费观看| 美国av一区二区| 亚洲不卡一区二区三区| 中文字幕不卡在线播放| 亚洲精品综合在线| 亚洲第一成人在线| 六月丁香综合在线视频| 成人免费视频国产在线观看| 欧美在线视频不卡| 日韩欧美一区电影| 国产精品福利av| 天堂成人免费av电影一区| 久久99国内精品| 午夜精品久久久久久久久久 | 久久久久久久一区| 亚洲卡通动漫在线| 蜜臀精品久久久久久蜜臀| 成人av高清在线| 日韩欧美中文一区| 亚洲日本青草视频在线怡红院| 国产精品全国免费观看高清| 日日嗨av一区二区三区四区| 大胆欧美人体老妇| 欧美一卡2卡三卡4卡5免费| 亚洲同性同志一二三专区| 亚洲三级在线免费| 久久不见久久见中文字幕免费| 久久国产综合精品| 在线观看欧美黄色| 久久久www成人免费无遮挡大片| 精品国产成人系列| 亚洲精品欧美激情| 国产在线精品一区二区夜色| 欧美性大战久久久久久久| 国产日韩精品一区二区三区在线| 国产午夜精品一区二区| 日日欢夜夜爽一区| 免费成人在线影院| 欧美视频自拍偷拍| 亚洲视频免费观看| 成人午夜av电影| 久久奇米777| 中文字幕日韩欧美一区二区三区| 亚洲视频免费看| 成人免费看的视频| 久久亚洲二区三区| 另类小说综合欧美亚洲| 欧美性猛交一区二区三区精品| 欧美一区二区大片| 亚洲电影一级黄| 欧美无砖专区一中文字| 亚洲激情图片小说视频| 成人h精品动漫一区二区三区| 在线观看国产日韩| 日韩三级视频在线看| 天天综合天天综合色| 欧美主播一区二区三区| 夜夜嗨av一区二区三区中文字幕 |