Binary Tree Paths
2016-11-26
阅读 1 分钟
1.6kBinary Tree PathsGiven a binary tree, return all root-to-leaf paths. For example, given the following binary tree: {代码...} All root-to-leaf paths are: {代码...} 1.解题思路 求根节点到叶子节点的路径集合,采用深度搜索,利用递归实现。 2.代码 {代码...}