• 35.5%

https://leetcode.com/problems/sum-root-to-leaf-numbers/?tab=Description

Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.

An example is the root-to-leaf path 1->2->3 which represents the number 123.

Find the total sum of all root-to-leaf numbers.

56ms, 46.63%, July 15th, 2016

https://discuss.leetcode.com/topic/12048/5-ms-c-code-using-dfs

https://discuss.leetcode.com/topic/3025/one-of-the-easier-solution-using-preorder-traversal-recursion

One of the easier solution using preorder traversal (recursion)

The idea is to do a preorder traversal of the tree. In the preorder traversal, keep track of the value calculated till the current node, let this value be val. For every node, we update the val as val10 plus node’s data.*

#### python

76ms, 10.56%, July 15th, 2016

https://discuss.leetcode.com/topic/21363/python-solutions-dfs-stack-bfs-queue-dfs-recursively

Python solutions (dfs+stack, bfs+queue, dfs recursively).

#### java

solution 1:

1ms, 28.00%, July 15th, 2016

https://discuss.leetcode.com/topic/6731/short-java-solution-recursion

solution 2:

1ms, 28.00%, July 15th, 2016

https://discuss.leetcode.com/topic/644/can-you-improve-this-algorithm

Can you improve this algorithm?