2022年9月21日

每日一结

摘要: 尤其注意递归的条件,分析好了各种情况。再下手写(不然堆积屎山堆积)。 例如求二叉树的最小深度,就分三种情况。 无子节点;有一个子节点;有两个子节点。那么就很明晰 public int minDepth(TreeNode root) { if(root == null) { return 0; } e 阅读全文

posted @ 2022-09-21 17:13 xtdnn 阅读(22) 评论(0) 推荐(0)

导航