Open darwinrlo opened 4 years ago
In the worst case, the binary tree is a linked list, the input sequence is as long as there are nodes, and it's a match. Since we're using recursion, a stack frame is allocated for each node. So the space complexity is O(n).
We may not visit every node, but in the worst case, we would visit every node, making the time complexity O(n).
Sum of Path Numbers
Missteps
Areas of Improvement