Skip to content

Commit

Permalink
Update binary-tree-paths.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kamyu104 committed Aug 17, 2015
1 parent d8b7f7b commit 1045901
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Python/binary-tree-paths.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down

0 comments on commit 1045901

Please sign in to comment.