We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d7dc6fb commit d1d353cCopy full SHA for d1d353c
leetcode/easy/437_path_sum_III.md
@@ -13,10 +13,8 @@ This is similar to a DFS implementation.
13
14
The runtime can be calculated in this way.
15
For each recursive call, we want to traverse the left and right children down to the leaf nodes, this is O(N) runtime.
16
-Since we would have to do this again but for the left and right children, it about O(log(N)) for each.
17
-So we basically have O(N), O(log(N)), O(log(N)).
18
-The two O(log(N)) can be simplified to O(N-1).
19
-So O(N) and O(N-1) per call = O(2^N).
+Since we would have to do this again but for the left and right children, both could be combined to be O(N-1).
+So O(N) and O(N-1) = O(2^N).
20
21
Remember the formula for recursion, (Number of calls ^ (Big O per call))
22
0 commit comments