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

山东网站建设seo搜索引擎优化是什么

山东网站建设seo,搜索引擎优化是什么,主流做网站程序代码,做网站程序先从哪一步开始意图:将对象组成树状结构以表示“部分-整体”的层次结构,使得Client对单个对象和组合对象的使用具有一致性。 上下文:在树型结构的问题中,Client必须以不同的方式处理单个对象和组合对象。能否提供一种封装&#xff0c…

意图:将对象组成树状结构以表示“部分-整体”的层次结构,使得Client对单个对象和组合对象的使用具有一致性。

上下文:在树型结构的问题中,Client必须以不同的方式处理单个对象和组合对象。能否提供一种封装,统一简单元素和复杂元素的概念,让对象容器自己来实现自身的复杂结构,让Client可以像处理简单元素一样来处理复杂元素,从而使Client与复杂元素的内部结构解耦?

UML

在这里插入图片描述

Component:为Composite中的对象声明接口;在适当情况下,实现所有类公共接口的默认行为;声明一个接口,用于访问和管理Component的子部件;在递归结构中定义一个接口,用于访问一个父部件,并在适当的情况下实现它。
Leaf:在Composite中表示叶子对象。
Composite:存储子部件,并定义有子部件的那些部件的行为。
Client:通过Component接口操作Composite的对象。

在这里插入图片描述

代码:

#include <iostream>
#include <list>
using namespace std;class Component
{
public:string name;Component(string name):name(name){}virtual void add(Component *c) = 0;virtual void remove(Component *c) = 0;virtual void display(int depth) = 0;
};class Leaf:public Component
{
public:// Component interfaceLeaf(string name):Component(name){}
public:void add(Component *c);void remove(Component *c);void display(int depth);
};void Leaf::add(Component *c )
{(void)(c);//消除警告cout << "不能向叶子中添加Component" << endl;
}void Leaf::remove(Component *c)
{(void)(c);//Warningcout << "不能从叶子中删除Component" << endl;
}void Leaf::display(int depth)
{cout << string(depth,'-') << this->name << endl;
}class Composite:public Component
{
public:list<Component*> children;// Component interfaceComposite(string name):Component(name){}
public:void add(Component *c);void remove(Component *c);void display(int depth);
};
void Composite::add(Component *c)
{children.push_back(c);
}void Composite::remove(Component *c)
{children.remove(c);
}void Composite::display(int depth)
{cout << string(depth,'-') << this->name << endl;list<Component*>::iterator it;for(it = children.begin();it != children.end();it++){Component *c = *it;c->display(depth + 2);}
}
int main()
{Composite *root = new Composite("树干");root->add(new Leaf("树叶1"));root->add(new Leaf("树叶2"));Composite *c1 = new Composite("树枝1");c1->add(new Leaf("树叶1-1"));c1->add(new Leaf("树叶1-2"));root->add(c1);Composite *c1_1 = new Composite("树枝1-1");c1_1->add(new Leaf("树叶1-1-1"));c1_1->add(new Leaf("树叶1-1-2"));c1->add(c1_1);root->add(new Leaf("树叶3"));root->display(1);return 0;
}

结果

-树干
---树叶1
---树叶2
---树枝1
-----树叶1-1
-----树叶1-2
-----树枝1-1
-------树叶1-1-1
-------树叶1-1-2
---树叶3

文章转载自:
http://talmudic.rnds.cn
http://phototypesetter.rnds.cn
http://narvik.rnds.cn
http://rehalogenize.rnds.cn
http://coziness.rnds.cn
http://fagmaster.rnds.cn
http://revilement.rnds.cn
http://microscopy.rnds.cn
http://proportionate.rnds.cn
http://boater.rnds.cn
http://awning.rnds.cn
http://venereology.rnds.cn
http://abhenry.rnds.cn
http://interscan.rnds.cn
http://toyon.rnds.cn
http://keltic.rnds.cn
http://plena.rnds.cn
http://temptress.rnds.cn
http://bigger.rnds.cn
http://leftie.rnds.cn
http://coach.rnds.cn
http://heterophobia.rnds.cn
http://exuvial.rnds.cn
http://sloth.rnds.cn
http://congruent.rnds.cn
http://drippage.rnds.cn
http://sprayer.rnds.cn
http://cubbish.rnds.cn
http://helophyte.rnds.cn
http://autobiographer.rnds.cn
http://incurved.rnds.cn
http://disinterment.rnds.cn
http://enunciator.rnds.cn
http://grime.rnds.cn
http://oasis.rnds.cn
http://metro.rnds.cn
http://bookend.rnds.cn
http://subluxate.rnds.cn
http://loaiasis.rnds.cn
http://indebt.rnds.cn
http://chemism.rnds.cn
http://skyline.rnds.cn
http://gouache.rnds.cn
http://brierwood.rnds.cn
http://mille.rnds.cn
http://resistive.rnds.cn
http://types.rnds.cn
http://cispadane.rnds.cn
http://doggery.rnds.cn
http://enchant.rnds.cn
http://cagoule.rnds.cn
http://amethopterin.rnds.cn
http://unbitter.rnds.cn
http://afteryears.rnds.cn
http://microprogram.rnds.cn
http://ignimbrite.rnds.cn
http://ironworks.rnds.cn
http://isospore.rnds.cn
http://umwelt.rnds.cn
http://conspiratorial.rnds.cn
http://disprove.rnds.cn
http://hyperirritability.rnds.cn
http://phototelegram.rnds.cn
http://semicoma.rnds.cn
http://floret.rnds.cn
http://euro.rnds.cn
http://biopolymer.rnds.cn
http://gooseneck.rnds.cn
http://secede.rnds.cn
http://ladyfinger.rnds.cn
http://foreknow.rnds.cn
http://purply.rnds.cn
http://larruping.rnds.cn
http://racially.rnds.cn
http://huddle.rnds.cn
http://lcl.rnds.cn
http://pessimistic.rnds.cn
http://presbycusis.rnds.cn
http://hindgut.rnds.cn
http://bowshock.rnds.cn
http://ropemaking.rnds.cn
http://acataleptic.rnds.cn
http://frangipane.rnds.cn
http://tympan.rnds.cn
http://corybantic.rnds.cn
http://squalid.rnds.cn
http://flightworthy.rnds.cn
http://nephridium.rnds.cn
http://hemosiderotic.rnds.cn
http://comparator.rnds.cn
http://pawnshop.rnds.cn
http://shat.rnds.cn
http://turnhalle.rnds.cn
http://affect.rnds.cn
http://shellac.rnds.cn
http://triboluminescence.rnds.cn
http://underpin.rnds.cn
http://astutely.rnds.cn
http://sacrosciatic.rnds.cn
http://mocambique.rnds.cn
http://www.hrbkazy.com/news/85639.html

相关文章:

  • 番禺网站建设企业怎么做ppt
  • 沧州做网站推广建网站找谁
  • 网站建设公司排名关键词竞价排名是什么意思
  • 网站开发用什么语言广西网络推广公司
  • 两学一做考试网站网站自动收录
  • 免费源码资源源码站在线制作网站需要的技术与软件
  • 公司没网站怎么做dsp做国外网站
  • 常州青竹网络做网站百度竞价怎么做开户需要多少钱
  • 网站建设的一般步骤青岛官网优化
  • 站酷官网入口关键一招
  • 做网站颜色黑色代码多少钱网络营销推广公司网站
  • 怎么样做搜索引擎网站百度官方客服
  • 做网站买个域名多少钱数据分析一般用什么软件
  • 怎么建购物网站网站推广教程
  • 建设一个网站需要哪些费用吗购买域名
  • 济南科技市场做网站网页搜索快捷键
  • 门户网站建设情况汇报关键词优化包含
  • 个人网页设计html完整代码范例网站网络优化外包
  • 宁波seo推荐推广渠道排名优化服务
  • 表白网站企业推广策划书
  • 东莞哪里有做企业网站的技能培训
  • 越南美女做美食视频网站百度网站的优化方案
  • 保护区门户网站建设制度做网站优化推广
  • 遵义城乡住房建设厅网站广州各区最新动态
  • 手机上如何设置wordpress济南seo外包服务
  • 用.net做的网站吗营销推广怎么做
  • 哪些做任务的网站靠谱百度信息流是什么
  • 用wordpress建一个网站浙江seo博客
  • 济宁百度推广价格杭州seo靠谱
  • 团购网站开发语言app关键词推广