搜索结果
查询Tags标签: digui,共有 4条记录-
阶乘(n!)的算法
1 public class DiGui {2 public static void main(String[] args) {3 DiGui diGui = new DiGui();4 System.out.println(diGui.multiply(10));5 public int multiply(int sum){6 if(sum==1){7 return 1;8 }else…
2022/7/13 1:26:27 人评论 次浏览 -
java算法训练第十天
目录 题库一、二叉树的三种遍历方式(递归思维)1.前序遍历2.中序遍历3.后序遍历 二、验证二叉搜索树1.递归解法2.中序遍历解法 总结题库 一、二叉树的三种遍历方式(递归思维) 给你二叉树的根节点 root ,返回它节点值的 前序(中序,后序) 遍历。 1.前序遍历 原题 代码…
2022/3/18 22:28:06 人评论 次浏览 -
【leetcode】1022. Sum of Root To Leaf Binary Numbers
ou are given the root of a binary tree where each node has a value 0 or 1. Each root-to-leaf path represents a binary number starting with the most significant bit.For example, if the path is 0 -> 1 -> 1 -> 0 -> 1, then this could represen…
2022/1/11 23:34:10 人评论 次浏览 -
【leetcode】1022. Sum of Root To Leaf Binary Numbers
ou are given the root of a binary tree where each node has a value 0 or 1. Each root-to-leaf path represents a binary number starting with the most significant bit.For example, if the path is 0 -> 1 -> 1 -> 0 -> 1, then this could represen…
2022/1/11 23:34:10 人评论 次浏览