当前位置:网站首页>NC84 完全二叉树结点数
NC84 完全二叉树结点数
2022-08-09 13:02:00 【syc596】
NC84 完全二叉树结点数
完全二叉树结点数_牛客题霸_牛客网 (nowcoder.com)
222. 完全二叉树的节点个数
222. 完全二叉树的节点个数 - 力扣(LeetCode)
// //递归-遍历思路
// public class Solution {
// int count=0;
// public int nodeNum(TreeNode root) {
// if(root==null){
// return 0;
// }
// count++;
// nodeNum(root.left);
// nodeNum(root.right);
// return count;
// }
// }
//11
//递归-子问题思路
public class Solution {
public int nodeNum(TreeNode root) {
if(root==null){
return 0;
}
return nodeNum(root.left)+nodeNum(root.right)+1;
}
}
边栏推荐
- LeetCode 37. Solve Sudoku
- 5G China unicom AP:B SMS ASCII Transcoding Requirements
- 43. The sword refers to Offer 1 ~ 1 the number of occurrences of n integers (recursive, mathematics)
- 联通网管协议框图
- [极客大挑战 2019]Upload
- render解析
- gin的中间件和路由分组
- R语言kaggle 游戏数据探索与可视化
- JS轮播图实现
- CPU-MIPS32 instruction architecture (unlocked pipeline microprocessor)
猜你喜欢
Unity3d_API_Gyroscope 陀螺仪的接口
七夕力扣刷不停,343. 整数拆分(剑指 Offer 14- I. 剪绳子、剑指 Offer 14- II. 剪绳子 II)
WSA工具箱安装应用商店提示无法工作怎么解决?
GIN文件上传与返回
RTSP协议讲解
5G China unicom repeater network management protocol real-time requirements
5G China unicom AP:B SMS ASCII Transcoding Requirements
Jenkins API groovy调用实践: Jenkins Core Api & Job DSL创建项目
某高校的R语言数据分析期末作业
5G Unicom Network Management Design Ideas
随机推荐
glibc memory management model freeing C library memory cache
昇腾AI开发者创享日南京站!一起CANN机器狗+AI机械臂实现硬核智慧救援!燃爆现场~
Standing wave ratio calculation method
The sword refers to the offer, cuts the rope 2
自己做了个nodejs+epxress+mysql的小项目,怎么才能让别人通过互联网访问呢?
Professor Chen Qiang's "Machine Learning and R Application" course Chapter 16 Assignment
5G China unicom 直放站 网管协议 实时性要求
kustomize entry example and basic syntax instructions
GIN Bind mode to get parameters and form validation
LeetCode 37. Solve Sudoku
Q_06_05 文件结构
行程和用户[阅读理解法]
GIN初探,环境安装
Final assignment of R language data analysis in a university
缓存和数据库一致性问题
Q_06_02 类型模型
NFS pays special attention to the problem of permissions
【奖励公示】第23期 2022年7月奖励名单公示:社区明星评选 | 新人奖 | 博客同步 | 推荐奖
WSA toolkit installed app store tip doesn't work how to solve?
read stream special attention