题目描述
Given a binary tree, return all root-to-leaf paths.
Note: A leaf is a node with no children.
Example:
1 | Input: |
使用DFS来找所有的path后,打印即可。
代码实现
1 | class Solution { |
题目描述
Given a binary tree, return all root-to-leaf paths.
Note: A leaf is a node with no children.
Example:
1 | Input: |
使用DFS来找所有的path后,打印即可。
代码实现
1 | class Solution { |