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

网站优化 ppt网站页面设计有哪些

网站优化 ppt,网站页面设计有哪些,Wordpress网站删除多余主题,高端网站建设 工业提示#xff1a;文章写完后#xff0c;目录可以自动生成#xff0c;如何生成可参考右边的帮助文档 文章目录 前言一、力扣971. 翻转二叉树以匹配先序遍历二、力扣987. 二叉树的垂序遍历三、力扣666. 路径总和 IV 前言 二叉树的递归分为「遍历」和「分解问题」两种思维模式文章写完后目录可以自动生成如何生成可参考右边的帮助文档 文章目录 前言一、力扣971. 翻转二叉树以匹配先序遍历二、力扣987. 二叉树的垂序遍历三、力扣666. 路径总和 IV 前言 二叉树的递归分为「遍历」和「分解问题」两种思维模式这道题需要用到「遍历」的思维。 一、力扣971. 翻转二叉树以匹配先序遍历 /*** Definition for a binary tree node.* public class TreeNode {* int val;* TreeNode left;* TreeNode right;* TreeNode() {}* TreeNode(int val) { this.val val; }* TreeNode(int val, TreeNode left, TreeNode right) {* this.val val;* this.left left;* this.right right;* }* }*/ class Solution {ListInteger res new ArrayList();int[] voyageArr;int i 0;boolean flag true;public ListInteger flipMatchVoyage(TreeNode root, int[] voyage) {voyageArr voyage;fun(root);if(flag false){ListInteger list new ArrayList();list.add(-1);return list;}return res;}public void fun(TreeNode root){if(root null){return;}if(root.val ! voyageArr[i]){flag false;return;}if(root.left ! null root.left.val ! voyageArr[i]){res.add(root.val);TreeNode temp root.left;root.left root.right;root.right temp;}fun(root.left);fun(root.right);} }二、力扣987. 二叉树的垂序遍历 /*** Definition for a binary tree node.* public class TreeNode {* int val;* TreeNode left;* TreeNode right;* TreeNode() {}* TreeNode(int val) { this.val val; }* TreeNode(int val, TreeNode left, TreeNode right) {* this.val val;* this.left left;* this.right right;* }* }*/ class Solution {class Triple{TreeNode node;int row, col;public Triple(TreeNode node, int row, int col){this.node node;this.row row;this.col col;}}LinkedListListInteger res new LinkedList();ListTriple nodes new ArrayList();public ListListInteger verticalTraversal(TreeNode root) {traverse(root,0,0);Collections.sort(nodes, (tri1,tri2)-{if(tri1.col ! tri2.col){return tri1.col - tri2.col;}else if(tri1.row ! tri2.row){return tri1.row - tri2.row;}else{return tri1.node.val - tri2.node.val;}});int pre Integer.MIN_VALUE;for(int i 0; i nodes.size(); i ){Triple cur nodes.get(i);if(cur.col ! pre){res.addLast(new LinkedListInteger());pre cur.col;}res.getLast().add(cur.node.val);}return res;}public void traverse(TreeNode root, int row, int col){if(root null){return ;}nodes.add(new Triple(root,row,col));traverse(root.left, row1, col-1);traverse(root.right, row1, col 1);} }三、力扣666. 路径总和 IV class Solution {MapInteger,Integer tree new HashMap();int sum 0;public int pathSum(int[] nums) {for(int i 0; i nums.length; i ){int value nums[i]%10;int code nums[i]/10;tree.put(code,value);}int rootCode nums[0]/10;fun(rootCode,0);return sum;}public void fun(int code, int path){if(!tree.containsKey(code)){return;}int value tree.get(code);int[] pos decode(code);int depth pos[0], id pos[1];int leftCode encode(depth1, 2*id-1);int rightCode encode(depth1,2*id);if(!tree.containsKey(leftCode) !tree.containsKey(rightCode)){sum path value;return;}fun(leftCode, path value);fun(rightCode, path value);}public int[] decode(int code){int id code%10;int depth code/10;return new int[]{depth,id};}public int encode(int depth, int id){return depth*10 id;} }
http://wiki.neutronadmin.com/news/60707/

相关文章:

  • 网站模板用什么打开旅游网站系统源码
  • 网站建设公司口碑排名关键词是什么意思
  • 专业建站推广服务网站建设的平台
  • 做网站用广告赚钱过时了互联网工程师
  • 国外做旅游攻略的网站wordpress 调用 编辑器
  • 焦作北京网站建设旅游网站的功能设计
  • 网页设计与网站建设作品个人做网站花多少钱
  • 深圳市公司网站建设企业清河做网站
  • 广州专业网站建设哪家好香水网站开源模板
  • 网站网页设计代码wordpress速度慢设置
  • 怎么做素材网站十二师建设局网站
  • 百度店铺网站seo优化价格
  • php网站开发前端如何申请成立公司
  • 深圳南山网站建设工作室自己做图片的网站吗
  • 领动建站科技资讯
  • 月嫂的个人简历网站模板商标自动生成免费软件
  • 怎么找到网站的空间服务商wordpress 图片失效
  • 温岭网站开发阜阳做网站的网络公司
  • 请人建设网站需要注意什么网站建设单位是什么
  • 网站不能写入php文件郑州网络
  • 外贸响应式网站建设做两个网站 之间超链接
  • 做海外市场什么网站推广亚马逊网站开发设计
  • 单页网站程序天眼查公司查询企业查询
  • 南通网站建设制作公司网店代运营合同模板
  • 泉港报名网站建设需要东莞企业网站建设开发公司
  • 最大的网站建设营销型网站建设的流程
  • 娱乐手机网站开发东莞模板建网站平台
  • 网站开发项目需求分析书护肤品网站建设策划书
  • 西宁网站搭建专业公司免费发布产品信息网站
  • 招商网站建设需要什么抖音代运营服务框架