diff --git a/Python/binary-tree-paths.py b/Python/binary-tree-paths.py index 1314f3730..657e8d579 100644 --- a/Python/binary-tree-paths.py +++ b/Python/binary-tree-paths.py @@ -1,6 +1,20 @@ # Time: O(n * h) # Space: O(h) # +# 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"] +# +# # Definition for a binary tree node. # class TreeNode: # def __init__(self, x):