摘要:
Given a n-ary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest le 阅读全文
posted @ 2019-07-08 17:50
bossman
阅读(268)
评论(0)
推荐(0)
摘要:
每次调用dfs函数,得到返回值的时候就是加入新解的时候,根据depth来判断这个解属于新的一层还是已有层。此题的逻辑非常符合深度优先搜索的本质:到达叶子节点后逐级回溯 阅读全文
posted @ 2019-07-08 14:13
bossman
阅读(303)
评论(0)
推荐(0)

浙公网安备 33010602011771号