404. Sum of Left Leaves
1. Description
Find the sum of all left leaves in a given binary tree.
2. Solutions
Two Pointers
n is the number of nodes in i_root
Time complexity: O(nk)
Space complexity: O(1)
| |
Algorithm Solutions
Personal Algorithm Solutions (primarily from LeetCode)
Find the sum of all left leaves in a given binary tree.
n is the number of nodes in i_root
Time complexity: O(nk)
Space complexity: O(1)
| |