国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當前位置: 首頁 > news >正文

公眾號做視頻網(wǎng)站會封嗎市場推廣方案范文

公眾號做視頻網(wǎng)站會封嗎,市場推廣方案范文,百度不收錄什么網(wǎng)站,遼寧網(wǎng)站建站系統(tǒng)平臺list庫實現(xiàn)的要點&#xff1a; 構建list類時&#xff0c;需要同時構建struct Node來存儲節(jié)點信息&#xff0c;list類中只存儲哨兵位節(jié)點信息&#xff0c;迭代器類需要template<T,Ptr,Ref>來構建const和非const迭代器&#xff0c;迭代器中也是存儲節(jié)點信息。反向迭代器也…

list庫實現(xiàn)的要點:

構建list類時,需要同時構建struct Node來存儲節(jié)點信息,list類中只存儲哨兵位節(jié)點信息,迭代器類需要template<T,Ptr,Ref>來構建const和非const迭代器,迭代器中也是存儲節(jié)點信息。反向迭代器也是同樣道理,但是可以用迭代器來構建反向迭代器。具體代碼如下?

#include<iostream>
#include<assert.h>
#include<algorithm>
using namespace std;template<class T>
struct __list_node
{__list_node(const T& val = T()):_data(val),_prev(nullptr),_next(nullptr){}__list_node* _prev;__list_node* _next;T _data;
};//構建每個節(jié)點//構建迭代器struct
template<class T, class Ptr, class Ref>
struct __list_iterator
{typedef __list_node<T> Node;typedef __list_iterator<T, Ptr, Ref> Self;Node* _node;//成員變量還是節(jié)點,只是在成員函數(shù)做手腳__list_iterator(Node* val ):_node(val){}Self& operator++(){_node = _node->_next;return *this;}Self operator++(int)//后置{Self tmp = *this;++(*this);return tmp;}Self& operator--(){_node = _node->_prev;return *this;}Self operator--(int){Self tmp = *this;--(*this);return tmp;}Ptr operator->(){return &(_node->_data);}Ref operator*(){return _node->_data;}bool operator!= ( const Self& val ){return !(_node == val._node);}};
template<class T,class Ptr,class Ref>
struct __list_reverse_iterator
{typedef __list_iterator<T, T*, T&> iterator;typedef __list_reverse_iterator<T, T*, T&> Self;iterator _it;__list_reverse_iterator(iterator it):_it(it){}Self operator++(){_it = _it._node->_prev;return *this;}T& operator*(){return _it._node->_data;}bool operator!=(const Self& rit){return !(_it._node == rit._it._node);}};//構建雙向帶頭循環(huán)鏈表
template<class T>
class list
{typedef __list_node<T> Node;
public:typedef __list_iterator<T,T*,T&> iterator;typedef __list_iterator<T, const T*, const T&> const_iterator;typedef __list_reverse_iterator<T, T*, T&> reverse_iterator;reverse_iterator rbegin(){return reverse_iterator(--end());}reverse_iterator rend(){return reverse_iterator(end());}iterator begin(){return iterator(_phead->_next);}const_iterator begin()const{return const_iterator(_phead->_next);}iterator end(){return iterator(_phead);}const_iterator end()const{return const_iterator(_phead);}list()//開頭空間,初始化{_phead = new Node;_phead->_next = _phead;_phead->_prev = _phead;}~list(){clear();delete _phead;_phead = nullptr;}//拷貝構造(先創(chuàng)建一個哨兵位,然后再pushback)list(const list<T>& l){_phead = new Node;_phead->_next = _phead;_phead->_prev = _phead;for (auto& x : l){push_back(x);}}list<T>& operator=(const list<T>& l){list<T> tmp(l);swap(_phead, tmp._phead);return *this;}//尾插入void push_back(const T& val){//Node* tail = _phead->_prev;//Node* newnode = new Node(val);更變鏈接//tail->_next = newnode;//newnode->_prev = tail;//newnode->_next = _phead;//_phead->_prev = newnode;insert(end(), val);}//頭插void push_front(const T& val){insert(begin(), val);}//頭刪除void pop_front(){erase(begin());}//尾刪除void pop_back(){erase(--end());}//清空節(jié)點(除了哨兵位,都清除)void clear(){iterator it = begin();while (it != end()){it = erase(it);}}//隨機插入void insert(iterator pos, const T& val){Node* pcur = pos._node;Node* prev = pcur->_prev;Node* newnode = new Node(val);//構建聯(lián)系newnode->_prev = prev;newnode->_next = pcur;prev->_next = newnode;pcur->_prev = newnode;}//刪除指定位置(不能將哨兵位刪掉!!iterator erase(iterator pos){assert(pos != end());Node* pcur = pos._node;Node* prev = pcur->_prev;Node* next = pcur->_next;delete pcur;pcur = nullptr;prev->_next = next;next->_prev = prev;return iterator(next);}private:Node* _phead;
};

http://aloenet.com.cn/news/37404.html

相關文章:

  • 建設一個網(wǎng)站需要什么西安網(wǎng)站seo費用
  • 禪城網(wǎng)站建設報價網(wǎng)站首頁排名seo搜索優(yōu)化
  • 電子商務網(wǎng)站建設和管理的含義百度競價登陸
  • vs網(wǎng)站畢業(yè)設計怎么做西安seo網(wǎng)絡推廣
  • b2b b2c 網(wǎng)站建設seo網(wǎng)站關鍵詞優(yōu)化多少錢
  • 做推送網(wǎng)站今天最新的新聞頭條新聞
  • 有的網(wǎng)站打不開是什么原因呢google搜索引擎入口下載
  • 網(wǎng)站站點創(chuàng)建成功了該怎么做外包公司為什么沒人去
  • 做視頻網(wǎng)站怎么備案百度競價點擊軟件奔奔
  • seo與網(wǎng)站建設教師遭網(wǎng)課入侵直播錄屏曝光廣場舞
  • 大型服裝商城網(wǎng)站建設世界羽聯(lián)巡回賽總決賽
  • 高端手機網(wǎng)站百度圖片識別
  • 響應式網(wǎng)站開發(fā)視頻定制網(wǎng)站建設推廣服務
  • 網(wǎng)站數(shù)據(jù)庫空間增大企業(yè)網(wǎng)站推廣公司
  • 桂林旅游網(wǎng)seo關鍵詞布局
  • 賭粉在哪個平臺引流南昌seo
  • 南京網(wǎng)站制作百家號恢復正常百度
  • 經(jīng)營性網(wǎng)站可以進行非經(jīng)營行網(wǎng)站備案嗎代刷網(wǎng)站推廣快速
  • 站點推廣是什么意思關鍵詞密度
  • 怎么搭建網(wǎng)站后臺日本比分算1:1
  • 做印刷網(wǎng)站公司哪家好熱詞搜索排行榜
  • 做動漫的網(wǎng)站長沙網(wǎng)絡營銷公司
  • 南京建設工程交易中心網(wǎng)站seo的內容主要有哪些方面
  • 做茶葉網(wǎng)站的素材上海網(wǎng)絡公司seo
  • 做公司網(wǎng)站需要多少錢杭州百度首頁優(yōu)化
  • 廊坊網(wǎng)站關鍵詞優(yōu)化seo關鍵詞是什么
  • 如何在騰訊云做網(wǎng)站福州排名seo公司
  • 制作網(wǎng)站的知識免費推廣方式有哪些
  • 做網(wǎng)站前端網(wǎng)絡營銷試題庫及答案
  • 做噯噯的網(wǎng)站科學新概念外鏈平臺