摘要: 参考 https://blog.csdn.net/wonner_/article/details/80373871 回溯算法的定义:回溯算法也叫试探法,它是一种系统地搜索问题的解的方法。回溯算法的基本思想是:从一条路往前走,能进则进,不能进则退回来,换一条路再试。 回溯算法实际上一个类似枚举的搜索尝 阅读全文
posted @ 2018-11-08 16:32 KeepAC 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 104. Maximum Depth of Binary Tree 求二叉树最大深度 return its depth = 3. 559. Maximum Depth of N-ary Tree 一开始写成这样, 结果怎么都不对: 因为 这里 maxDepth(child) 根本不会 hit roo 阅读全文
posted @ 2018-11-08 13:07 KeepAC 阅读(225) 评论(0) 推荐(0) 编辑