原题链接:https://leetcode-cn.com/problems/er-cha-shu-de-shen-du-lcof/

dfs

int maxDepth(TreeNode* root) {if (root == NULL) return 0;return max(maxDepth(root->left),maxDepth(root->right)) + 1;
}

leetcode算法题--二叉树的深度相关推荐

  1. leetcode算法题--二叉树中的最长交错路径★

    原题链接:https://leetcode-cn.com/problems/longest-zigzag-path-in-a-binary-tree/ 嵌套递归(超时) 相关题目:二叉树中的列表 in ...

  2. leetcode算法题--二叉树中序遍历迭代法

    原题链接:https://leetcode-cn.com/problems/binary-tree-inorder-traversal/ 二叉树中序遍历迭代法,栈实现 vector<int> ...

  3. leetcode算法题--二叉树中和为某一值的路径

    原题链接:https://leetcode-cn.com/problems/er-cha-shu-zhong-he-wei-mou-yi-zhi-de-lu-jing-lcof/ vector< ...

  4. leetcode算法题--二叉树的最近公共祖先

    原题链接:https://leetcode-cn.com/problems/er-cha-shu-de-zui-jin-gong-gong-zu-xian-lcof/ TreeNode* lowest ...

  5. leetcode算法题--二叉树的镜像

    原题链接:https://leetcode-cn.com/problems/er-cha-shu-de-jing-xiang-lcof/ TreeNode* mirrorTree(TreeNode* ...

  6. leetcode算法题--二叉树中的伪回文路径

    原题链接:https://leetcode-cn.com/problems/pseudo-palindromic-paths-in-a-binary-tree/ 这题的技巧是判断奇偶,如一条路径为[2 ...

  7. leetcode算法题--二叉树中的列表★

    原题链接:https://leetcode-cn.com/problems/linked-list-in-binary-tree/ 嵌套递归 bool isSubPath(ListNode* head ...

  8. leetcode算法题--二叉树的前序遍历

    题目链接:https://leetcode-cn.com/problems/binary-tree-preorder-traversal/ 二叉树前序遍历,栈实现 vector<int> ...

  9. leetcode算法题--二叉树的锯齿型层次遍历

    题目链接: https://leetcode-cn.com/problems/binary-tree-zigzag-level-order-traversal/ https://leetcode-cn ...

最新文章

  1. NSA释出逆向工程工具GHIDRA针对恶意软件逆向分析
  2. 最近公共祖先(Lowest_Common_Ancestors)
  3. WebSocket学习
  4. 设计模式解析笔记之Adapter模式
  5. html 怎么置顶表格,表格(Table)表头固定,内容上滚【5个实例】
  6. pythonlocust使用方法_使用python的locust库进行性能测试
  7. 三菱fx5u编程手册_FX5U系列PLC控制伺服3种方式
  8. python字典添加数组_一步一步学Python3(小学生也适用) 第十三篇: 字典Dict类型
  9. Lintcode93 Balanced Binary Tree solution 题解
  10. iOS:Xcode8以下真机测试iOS10.0和iOS10.1配置包
  11. 自动改变文字大小和颜色的javascript效果
  12. Spring Data Jpa的@DynamicInsert注解和@DynamicUpdate注解
  13. 服务器怎么修改sqlroot密码,mysql设置更改root密码、mysql服务器的连接、mysql常用命令的图解...
  14. android自定义广播实现app完全退出
  15. 基于MC1496乘法器的AM信号调制
  16. Ubuntu安装客户端RabbitVCS(svn管理)
  17. 删除文件时出现找不到该项目 请确认该项目位置 怎么办【转】
  18. 小学计算机说课稿模板,小学信息技术说课稿模板
  19. 典型双层神经网络的正向/反向传播计算图
  20. 【CVPR2022】Beyond Fixation: Dynamic Window Visual Transformer

热门文章

  1. 怎么用python画简单的图-用python进行简单的画图操作
  2. python线上培训多少钱-Python人工智能在线培训班学费多少钱?
  3. python中的format什么意思中文-Python中format的用法
  4. python游戏编程入门 免费-python游戏编程入门 python游戏编程入门课
  5. 服务器的BIOS引导模式设置为什么,Legacy BIOS 引导模式和 UEFI 引导模式
  6. php语法大全下载,PHP下载文件
  7. es中的DiscoveryModule
  8. linux下查看监听端口对应的进程
  9. 4.11 日期/时间的程序
  10. hdu1042 N!