第89天。
今天的题目是Binary-Tree-Paths:
Given a binary tree, return all root-to-leaf paths.
For example, given the following binary tree:
1
/
2 3
5
All root-to-leaf paths are:
[“1->2->5”, “1->3”]
比较的简单的题目,直接用递归做就好了,因为python
写起来比较简单,所以这里用python
实现: