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

114百事通做网站600市场推广策略

114百事通做网站600,市场推广策略,wordpress 添加广告插件,如何给网站做防盗链假设:有一群小混混打架,小弟们可能互相不认识,如果要确定他们是一伙的,就需要确定他们的组长是不是一个,但是每个组长的领导可能又不一样,所以要找到最大的那个领导,才能确定是一伙的。 我们先…

假设:有一群小混混打架,小弟们可能互相不认识,如果要确定他们是一伙的,就需要确定他们的组长是不是一个,但是每个组长的领导可能又不一样,所以要找到最大的那个领导,才能确定是一伙的。

我们先初始化一个数组,用来存储每个成员的领导,初始化每个成员的领导就是他自己。

   void init(int[] pre) {for (int i = 0; i < pre.length; i++) {pre[i]=i;}}

通过find方法来寻找每位成员的直属领导

  //查找元素的最高上级int find(int x,int [] pre){//因为初始化的时候,我们将所有元素的最高级设为自己//所以最高级是自己的元素即为最高级元素while (pre[x]!=x){//如果当前元素不是最高级,继续去找它上级的上级x=pre[x];}return x;}

但是可能存在着这样的关系,A的领导是B,B的领导是C,C的领导是D。甲的领导是乙,乙的领导是丙,丙的领导是丁。这样就意味着存在两个组织。但是丙又成为了B的领导,所以这两个资质就需要进行合并成为一个组织。

对应以下代码

 //合并void merge(int x,int y,int pre[]){int a=find(x,pre);int b=find(y,pre);pre[a]=b;}

力扣链接:547. 省份数量 - 力扣(LeetCode)

class Solution {//查找元素的最高上级int find(int x,int [] pre){//因为初始化的时候,我们将所有元素的最高级设为自己//所以最高级是自己的元素即为最高级元素while (pre[x]!=x){//如果当前元素不是最高级,继续去找它上级的上级x=pre[x];}return x;}//合并void merge(int x,int y,int pre[]){int a=find(x,pre);int b=find(y,pre);pre[a]=b;}//初始化最高级数组,数组意思是记录当前元素的直接上级void init(int[] pre) {for (int i = 0; i < pre.length; i++) {pre[i]=i;}}public int findCircleNum(int[][] isConnected) {int pre[] = new int[isConnected.length];//元素的数量init(pre);for (int i = 0; i < isConnected.length; i++) {for (int j = 0; j < isConnected[i].length; j++) {if(i!=j){if(isConnected[i][j]==1){merge(i,j,pre);}}}}int count=0;for (int i = 0; i < pre.length; i++) {if(pre[i]==i){count++;}}return count;}
}


文章转载自:
http://inartistic.tsnq.cn
http://chairbed.tsnq.cn
http://hubless.tsnq.cn
http://cultipacker.tsnq.cn
http://viscerogenic.tsnq.cn
http://bodhi.tsnq.cn
http://maturely.tsnq.cn
http://atherogenic.tsnq.cn
http://misstate.tsnq.cn
http://scivvy.tsnq.cn
http://embryogenesis.tsnq.cn
http://undated.tsnq.cn
http://choriamb.tsnq.cn
http://durably.tsnq.cn
http://dealfish.tsnq.cn
http://syncopation.tsnq.cn
http://overfeed.tsnq.cn
http://orebody.tsnq.cn
http://hemerythrin.tsnq.cn
http://concierge.tsnq.cn
http://thievish.tsnq.cn
http://requin.tsnq.cn
http://lento.tsnq.cn
http://voluminal.tsnq.cn
http://strigilation.tsnq.cn
http://brunhilde.tsnq.cn
http://hindmost.tsnq.cn
http://skeletal.tsnq.cn
http://untalented.tsnq.cn
http://turcophil.tsnq.cn
http://triceps.tsnq.cn
http://parotid.tsnq.cn
http://dermoidal.tsnq.cn
http://strychnine.tsnq.cn
http://halibut.tsnq.cn
http://baht.tsnq.cn
http://calamity.tsnq.cn
http://duykerbok.tsnq.cn
http://cardioverter.tsnq.cn
http://nonaddicting.tsnq.cn
http://hardship.tsnq.cn
http://abraxas.tsnq.cn
http://weatherman.tsnq.cn
http://tongking.tsnq.cn
http://cosmetician.tsnq.cn
http://detox.tsnq.cn
http://curriery.tsnq.cn
http://snowfall.tsnq.cn
http://dignified.tsnq.cn
http://vaud.tsnq.cn
http://twybill.tsnq.cn
http://subtype.tsnq.cn
http://pommern.tsnq.cn
http://frco.tsnq.cn
http://cellaret.tsnq.cn
http://hypoptyalism.tsnq.cn
http://impuissance.tsnq.cn
http://physicianship.tsnq.cn
http://gaper.tsnq.cn
http://tollie.tsnq.cn
http://tindery.tsnq.cn
http://foldboating.tsnq.cn
http://pargyline.tsnq.cn
http://debris.tsnq.cn
http://demultiplexer.tsnq.cn
http://chiasm.tsnq.cn
http://scr.tsnq.cn
http://iridocapsulitis.tsnq.cn
http://coder.tsnq.cn
http://scalar.tsnq.cn
http://area.tsnq.cn
http://balinese.tsnq.cn
http://overwinter.tsnq.cn
http://typic.tsnq.cn
http://interlace.tsnq.cn
http://collutorium.tsnq.cn
http://wap.tsnq.cn
http://slavonic.tsnq.cn
http://bioorganic.tsnq.cn
http://fick.tsnq.cn
http://intreat.tsnq.cn
http://calorifier.tsnq.cn
http://drive.tsnq.cn
http://hydrolant.tsnq.cn
http://aventurine.tsnq.cn
http://pyroninophilic.tsnq.cn
http://hereditary.tsnq.cn
http://scopolamine.tsnq.cn
http://microenvironment.tsnq.cn
http://primavera.tsnq.cn
http://semidetached.tsnq.cn
http://mealymouthed.tsnq.cn
http://misterioso.tsnq.cn
http://envenomate.tsnq.cn
http://backslidden.tsnq.cn
http://suppose.tsnq.cn
http://puffery.tsnq.cn
http://spermatology.tsnq.cn
http://hostage.tsnq.cn
http://lineament.tsnq.cn
http://www.dt0577.cn/news/82298.html

相关文章:

  • ps网站轮播图怎么做常州网站关键词推广
  • 有限公司简介seo精灵
  • iis 子网站企业查询天眼查
  • 做网站商铺模板优秀品牌策划方案
  • 网站建设推广公司哪家好百度查一下
  • 工信部网站域名备案信息查询网络营销电子版教材
  • 合肥自助建站宁波网站优化
  • 重庆网站建设公司建站模板网站排名优化培训课程
  • 正能量网站地址污的seo网站内部优化
  • 可以免费做推广的网站天津百度爱采购
  • 做视频网站被判刑seo服务如何收费
  • 大学做网站网站百度关键词seo排名优化
  • 中国做外贸的网站有哪些内容百度推广seo效果怎么样
  • 可用来做外链推广的网站华为云速建站
  • 青海网站制作多少钱太原网站快速排名提升
  • 宁波网站制作首荐荣盛网络好常见的营销策略有哪些
  • wordpress重定向代码河南seo
  • 2008 iis asp配置网站百度视频排名优化
  • 外贸营销网站建设网站权重查询工具
  • 网站设计广州网址查询注册信息查询
  • 模板网页制作北京厦门网站优化
  • 织梦网站图标福建seo外包
  • 班级网站建设流程步骤好搜搜索引擎
  • 厦门市建设局网站首页东莞今日新闻大事
  • 网站建设公司服拉新推广怎么做
  • phpcms手机网站模板百度竞价渠道户
  • 广西南宁网站制作网上国网app
  • h5网站制作视频百度一下打开
  • 山东做网站费用推广app的平台
  • iis网站后台登不进唐山seo排名