当前位置: 首页 > news >正文

旅游网站排行榜前20wordpress缺少样式表

旅游网站排行榜前20,wordpress缺少样式表,网站建设的软件知识有哪些内容,wordpress后台管理菜单改名在了解底层封装之前除了对set和map的使用情况要有一定了解#xff0c;还需要先学习一下二叉搜索树#xff0c;AVL树#xff0c;红黑树这些数据结构。 【C】二叉搜索树 【C】AVL树 红黑树 RBTree.h enum Colour {RED,BLACK };templateclass T class RBTreeNo…在了解底层封装之前除了对set和map的使用情况要有一定了解还需要先学习一下二叉搜索树AVL树红黑树这些数据结构。 【C】二叉搜索树 【C】AVL树 红黑树 RBTree.h enum Colour {RED,BLACK };templateclass T class RBTreeNode { public:RBTreeNode(const T data): _data(data), _left(nullptr), _right(nullptr), _parent(nullptr){}T _data;RBTreeNodeT* _left;RBTreeNodeT* _right;RBTreeNodeT* _parent;Colour _col; };templateclass T, class Ref, class Ptr // 红黑树的迭代器实现 class __RBTreeIterator { public:typedef RBTreeNodeT Node;typedef __RBTreeIteratorT, Ref, Ptr Self; public:__RBTreeIterator(Node* node): _node(node){}Ref operator*(){return _node-_data;}Ptr operator-(){return _node-_data;}bool operator!(const Self s) const{return _node ! s._node;}bool operator(const Self s) const{return _node s._node;}Self operator(){// 右子树不为空if (_node-_right){// 就是找右子树的最左节点Node* left _node-_right;while (left-_left){left left-_left;}_node left;}// 右子树为空else{// 就是找不是其右孩子的祖先Node* parent _node-_parent;Node* cur _node;while (parent parent-_right cur){cur cur-_parent;parent parent-_parent;}_node parent;}return *this;}Self operator--(){// 左子树不为空if (_node-_left){// --就是找左子树的最右节点Node* right _node-_left;while (right-_right){right right-_right;}_node right;}// 左子树为空else{// --就是找不是其左孩子的祖先Node* parent _node-_parent;Node* cur _node;while (parent parent-_left cur){cur cur-_parent;parent parent-_parent;}_node parent;}return *this;} public:Node* _node; };// KeyOfT: 用于获取T中的key的一个仿函数类 templateclass K, class T, class KeyOfT class RBTree { private:typedef RBTreeNodeT Node; public:typedef __RBTreeIteratorT, T, T* iterator;RBTree(Node* root nullptr): _root(root){}// begin() 就是找红黑树的最左节点iterator begin(){Node* left _root;while (left left-_left){left left-_left;}return iterator(left);}// 因为迭代器是左闭右开所以end()的迭代器设置为空iterator end(){return iterator(nullptr);}pairiterator, bool Insert(const T data){KeyOfT kot;if (_root nullptr){_root new Node(data);_root-_col BLACK;return make_pair(iterator(_root), true);}Node* parent nullptr;Node* cur _root;while (cur){if (kot(data) kot(cur-_data)){parent cur;cur cur-_right;}else if (kot(data) kot(cur-_data)){parent cur;cur cur-_left;}else{return make_pair(iterator(cur), false);}}cur new Node(data);cur-_col RED;// 保存cur用于返回Node* newnode cur;if (kot(data) kot(parent-_data)){parent-_right cur;}else{parent-_left cur;}cur-_parent parent;while (parent parent-_col RED){Node* grandparent parent-_parent;if (parent grandparent-_left){Node* uncle grandparent-_right;if (uncle uncle-_col RED){parent-_col uncle-_col BLACK;grandparent-_col RED;cur grandparent;parent cur-_parent;}else{if (cur parent-_left){RotateR(grandparent);parent-_col BLACK;grandparent-_col RED;}else{RotateL(parent);RotateR(grandparent);cur-_col BLACK;grandparent-_col RED;}break;}}else{Node* uncle grandparent-_left;if (uncle uncle-_col RED){parent-_col uncle-_col BLACK;grandparent-_col RED;cur grandparent;parent cur-_parent;}else{if (cur parent-_right){RotateL(grandparent);parent-_col BLACK;grandparent-_col RED;}else{RotateR(parent);RotateL(grandparent);cur-_col BLACK;grandparent-_col RED;}break;}}}_root-_col BLACK;return make_pair(iterator(newnode), true);} private:void RotateL(Node* parent){Node* subR parent-_right;Node* subRL subR-_left;parent-_right subRL;if (subRL){subRL-_parent parent;}Node* ppNode parent-_parent;subR-_left parent;parent-_parent subR;if (_root parent){_root subR;subR-_parent nullptr;}else{if (ppNode-_left parent){ppNode-_left subR;}else{ppNode-_right subR;}subR-_parent ppNode;}}void RotateR(Node* parent){Node* subL parent-_left;Node* subLR subL-_right;parent-_left subLR;if (subLR){subLR-_parent parent;}Node* ppNode parent-_parent;subL-_right parent;parent-_parent subL;if (_root parent){_root subL;subL-_parent nullptr;}else{if (ppNode-_left parent){ppNode-_left subL;}else{ppNode-_right subL;}subL-_parent ppNode;}} private:Node* _root; };Set.h #include RBTree.hnamespace zs {templateclass Kclass set{public:class SetKeyOfT{public:const K operator()(const K key){return key;}};typedef typename RBTreeK, K, SetKeyOfT::iterator iterator;iterator begin(){return _t.begin();}iterator end(){return _t.end();}pairiterator, bool insert(const K key){return _t.Insert(key);}private:// set的底层就是一棵红黑树RBTreeK, K, SetKeyOfT _t;}; }Map.h #include RBTree.hnamespace zs {templateclass K, class Vclass map{public:class MapKeyOfT{public:const K operator()(const pairK, V kv){return kv.first;}};typedef typename RBTreeK, pairK,V, MapKeyOfT::iterator iterator;iterator begin(){return _t.begin();}iterator end(){return _t.end();}pairiterator, bool insert(const pairK, V kv){return _t.Insert(kv);}// map支持[]操作V operator[](const K key){pairiterator, bool ret insert(make_pair(key, V()));return ret.first-second;}private:// map的底层就是一棵红黑树RBTreeK, pairK, V, MapKeyOfT _t;};}
http://www.hkea.cn/news/14378656/

相关文章:

  • 网站打开速度hao123网址怎么删除
  • 阿里云上的网站空间好用吗政务服务网站建设运行情况
  • 汉中微信网站建设公司天圆地方建筑网站
  • 泸州网站seo主机怎么装wordpress
  • 成都设计电商网站百度收录入口提交
  • 建设网站需要买什么地瓜互联 wordpress
  • dw制作一个手机网站模板简洁型网页
  • 揭阳网站设计公司民宿网站的建设
  • 网站多语言包山东省建设厅的网站
  • 网站建设明薇通网络售后好网络营销就是建立企业网站
  • 佛山 两学一做 网站成都企业网站设计服务商
  • 2018年做返利网站环保网站可以做哪些方面
  • 网站规划的原则如何开一家网站建设公司?
  • 福建路桥建设有限公司网站如何安装wordpress博客
  • 青岛菜西有做网站的吗深圳公司排名前100名
  • 南阳做网站的公司中国纵横168网站建设系统
  • 网站浏览器兼容性问题做网站搭建需要什么人
  • 安徽省途顺建设工程有限公司网站网页版微信登录提示二维码已失效
  • 网站开发方案服装网站简介网店运营工资一般多少
  • 专门做礼品的网站广西壮族自治区建设厅网站
  • 自适应网站的优劣有网址吗给个谢谢急贴吧
  • 网站建设鼠标点击变色怎么弄徐州建设工程网官网
  • 珠宝首饰网站开发三河建设局网站
  • 免费网站自己做wordpress reset
  • 芜湖哪里做网站网络工程师主要做什么
  • 手机能访问asp网站网站设计优化
  • 东莞网站建设aj博客赣州网络
  • 网店装修视频seo运营是什么
  • 门户类网站开发多少钱大连网络运营
  • wordpress开发文档下载云南seo刷关键词排名优化