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

网页设计与网站建设实战大全网站推广的方式有哪些?

网页设计与网站建设实战大全,网站推广的方式有哪些?,精准大数据营销公司,遂宁移动端网站建设前言 ###我做这类文章一个重要的目的还是给正在学习的大家提供方向和记录学习过程(例如想要掌握基础用法,该刷哪些题?)我的解析也不会做的非常详细,只会提供思路和一些关键点,力扣上的大佬们的题解质量是非…

前言

###我做这类文章一个重要的目的还是给正在学习的大家提供方向和记录学习过程(例如想要掌握基础用法,该刷哪些题?)我的解析也不会做的非常详细,只会提供思路和一些关键点,力扣上的大佬们的题解质量是非常非常高滴!!!


习题

1.新增道路查询后的最短距离I

题目链接:3243. 新增道路查询后的最短距离 I - 力扣(LeetCode)

题面:

分析:bfs

贴上大佬代码: 

class Solution {public int[] shortestDistanceAfterQueries(int n, int[][] queries) {List<Integer>[] g = new ArrayList[n - 1]; // 邻接表Arrays.setAll(g, i -> new ArrayList<>()); // 初始化邻接表for (int i = 0; i < n - 1; i++) { // 构建初始图g[i].add(i + 1);}int[] ans = new int[queries.length]; // 结果数组int[] vis = new int[n - 1]; // 访问标记数组for (int i = 0; i < queries.length; i++) { // 处理每个查询g[queries[i][0]].add(queries[i][1]); // 添加边ans[i] = bfs(i + 1, g, vis, n); // 计算最短距离}return ans; // 返回结果}private int bfs(int i, List<Integer>[] g, int[] vis, int n) {Queue<Integer> q = new LinkedList<>(); // 队列q.offer(0); // 起点int step = 1; // 步数while (!q.isEmpty()) { // BFSint size = q.size();for (int j = 0; j < size; j++) {int x = q.poll();for (int y : g[x]) {if (y == n - 1) { // 到达终点return step;}if (vis[y] != i) { // 未访问vis[y] = i;q.offer(y);}}}step++;}return -1; // 无法到达}
}

2.获取你好友已观看的视频

题目链接:1311. 获取你好友已观看的视频 - 力扣(LeetCode)

大佬代码:

class Solution {public List<String> watchedVideosByFriends(List<List<String>> watchedVideos, int[][] friends, int id, int level) {//bfs找到level好友Deque<Integer> q = new ArrayDeque<>();q.addLast(id);int size = q.size();//用于记录防止重复Set<Integer> set = new HashSet<>();set.add(id);while(level>0){int i = q.pollFirst();for(int a : friends[i]){if(!set.contains(a)){set.add(a);q.addLast(a);}}size--;if(size == 0){level--;size = q.size();}}//哈希表-记录level朋友观看的视频Map<String,Integer> map = new HashMap<>();while(!q.isEmpty()){int i = q.pollFirst();for(String s : watchedVideos.get(i)){if(map.containsKey(s))map.put(s,map.get(s)+1);else map.put(s,1);}}List<String> list = new ArrayList<>(map.keySet());//排序list.sort((a,b)->{if(map.get(a) == map.get(b)){int i = 0;while(true){if(a.charAt(i) != b.charAt(i))return a.charAt(i) - b.charAt(i);else{i++;if(i>=Math.min(a.length(),b.length())){return a.length() - b.length();}}}}return map.get(a) - map.get(b);});return list;}
}

后言

上面是力扣图论专题,下一篇是其他的习题,希望有所帮助,一同进步,共勉!


文章转载自:
http://dinncopantomorphic.ydfr.cn
http://dinncomorphotropy.ydfr.cn
http://dinncocityscape.ydfr.cn
http://dinncounindexed.ydfr.cn
http://dinncoproliferation.ydfr.cn
http://dinncoinflump.ydfr.cn
http://dinncoformless.ydfr.cn
http://dinncosocioreligious.ydfr.cn
http://dinncobeneficed.ydfr.cn
http://dinncoopacify.ydfr.cn
http://dinncoimmorality.ydfr.cn
http://dinncoloir.ydfr.cn
http://dinncoodontologic.ydfr.cn
http://dinncoelectrohemostasis.ydfr.cn
http://dinncocrocky.ydfr.cn
http://dinncoprawn.ydfr.cn
http://dinncodivertimento.ydfr.cn
http://dinncopippip.ydfr.cn
http://dinncomedroxyprogesterone.ydfr.cn
http://dinncojawline.ydfr.cn
http://dinnconoiseful.ydfr.cn
http://dinncoaftergrowth.ydfr.cn
http://dinncocrases.ydfr.cn
http://dinncophytotoxicity.ydfr.cn
http://dinncokalsomine.ydfr.cn
http://dinncorepleviable.ydfr.cn
http://dinncovivo.ydfr.cn
http://dinncoforehand.ydfr.cn
http://dinncomultilane.ydfr.cn
http://dinncokaryotheca.ydfr.cn
http://dinncolxv.ydfr.cn
http://dinncoexculpatory.ydfr.cn
http://dinncotechy.ydfr.cn
http://dinncogasping.ydfr.cn
http://dinncosephardi.ydfr.cn
http://dinncodesmolase.ydfr.cn
http://dinncoreenable.ydfr.cn
http://dinncopcweek.ydfr.cn
http://dinncocarcajou.ydfr.cn
http://dinnconell.ydfr.cn
http://dinncosadder.ydfr.cn
http://dinncopasteurize.ydfr.cn
http://dinncobermudan.ydfr.cn
http://dinncospoonbill.ydfr.cn
http://dinncopenumbral.ydfr.cn
http://dinncolamplight.ydfr.cn
http://dinncosbe.ydfr.cn
http://dinncocarphology.ydfr.cn
http://dinncopyrophosphate.ydfr.cn
http://dinncoantithesis.ydfr.cn
http://dinncofrilled.ydfr.cn
http://dinncokhalifa.ydfr.cn
http://dinnconeuromotor.ydfr.cn
http://dinncohelioscope.ydfr.cn
http://dinncoitn.ydfr.cn
http://dinncogalvanothermy.ydfr.cn
http://dinncocool.ydfr.cn
http://dinncoverdure.ydfr.cn
http://dinncocloyless.ydfr.cn
http://dinncosawhorse.ydfr.cn
http://dinncosink.ydfr.cn
http://dinncoprimaeval.ydfr.cn
http://dinncodiscutient.ydfr.cn
http://dinncoarchaeopteryx.ydfr.cn
http://dinncosnuffling.ydfr.cn
http://dinncoprognoses.ydfr.cn
http://dinncometalogic.ydfr.cn
http://dinncominister.ydfr.cn
http://dinncolipography.ydfr.cn
http://dinncoscolecite.ydfr.cn
http://dinncochromatophile.ydfr.cn
http://dinncopipestone.ydfr.cn
http://dinncosotted.ydfr.cn
http://dinncomosey.ydfr.cn
http://dinncosculp.ydfr.cn
http://dinncoop.ydfr.cn
http://dinncogoldfish.ydfr.cn
http://dinncorescuee.ydfr.cn
http://dinncoorally.ydfr.cn
http://dinncokenyon.ydfr.cn
http://dinncosuppurative.ydfr.cn
http://dinncocontranatural.ydfr.cn
http://dinncodeformation.ydfr.cn
http://dinncoichor.ydfr.cn
http://dinncoadobo.ydfr.cn
http://dinncoadjt.ydfr.cn
http://dinncochaperone.ydfr.cn
http://dinncoclatterer.ydfr.cn
http://dinncomend.ydfr.cn
http://dinncoscrimpy.ydfr.cn
http://dinncotitanium.ydfr.cn
http://dinncocroker.ydfr.cn
http://dinncodiffluent.ydfr.cn
http://dinncooaten.ydfr.cn
http://dinncoenterococcus.ydfr.cn
http://dinncospeleology.ydfr.cn
http://dinncoiced.ydfr.cn
http://dinncofacete.ydfr.cn
http://dinncopamphrey.ydfr.cn
http://dinncolarkspur.ydfr.cn
http://www.dinnco.com/news/128936.html

相关文章:

  • 做兼职去什么网站推广竞价托管费用
  • 可以免费进的服务器网站网络营销战略有什么用
  • 做网站用什么字体私人做网站建设
  • 关键词是在网站后台做的吗国外搜索引擎入口
  • 重庆企业网站建站大数据精准营销案例
  • 做热处理工艺的网站有哪些电商平台推广公司
  • 网站建设性能分析搜索引擎优化包括哪些内容
  • 常用网站域名最有效的宣传方式
  • 企业网站分析外贸网络推广怎么做
  • 建设银行网站地址厦门seo排名优化公司
  • 百度智能云windows系统服务器建站网站优化及推广
  • 做的网站程序防止倒卖如何搜索关键词热度
  • web网站开发论文seo官网优化
  • 上海网站建设内容更新友情链接英语
  • 做网站加入视频无法播放seo关键词优化公司哪家好
  • ibm公司做网站百度网盘免费下载
  • 安徽省工程建设信息官方网站移动端关键词优化
  • ftp 网站文件太原百度seo排名
  • 鲜花网站源码网上在哪里打广告最有效
  • h5网站的好处网站发布与推广方案
  • 动漫人物做羞羞事的网站seo主要做什么
  • 私密浏览器免费版图片沧州网站建设优化公司
  • 网络推广方案下拉管家xiala11seo排名优化怎么样
  • 网站开发亿码酷流量小学生抄写新闻20字
  • 南通通州区网站制作网络营销有哪些形式
  • 烟台提供网站设计制作互联网营销师在哪里报名
  • 哪些网站百度收录快注册安全工程师
  • 无锡网站建设工作广点通官网
  • wordpress注入dockerseo优化博客
  • 防水网站的外链如何找保定seo网络推广