Skip to content

Commit 6d51d0a

Browse files
authored
Merge pull request soapyigu#73 from soapyigu/DFS
[DFS] fix Space Complexity of Combination I, II, III
2 parents 545d872 + fb1d6bf commit 6d51d0a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

DFS/CombinationSum.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Question Link: https://leetcode.com/problems/combination-sum/
33
* Primary idea: Classic Depth-first Search
44
*
5-
* Time Complexity: O(n^n), Space Complexity: O(n^n)
5+
* Time Complexity: O(n^n), Space Complexity: O(2^n - 1)
66
*
77
*/
88

DFS/combinationSumII.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Question Link: https://leetcode.com/problems/combination-sum-ii/
33
* Primary idea: Classic Depth-first Search
44
*
5-
* Time Complexity: O(n!), Space Complexity: O(n!)
5+
* Time Complexity: O(n!), Space Complexity: O(2^n - 2)
66
*
77
*/
88

DFS/combinationSumIII.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Question Link: https://leetcode.com/problems/combination-sum-iii/
33
* Primary idea: Classic Depth-first Search
44
*
5-
* Time Complexity: O(n!), Space Complexity: O(n!)
5+
* Time Complexity: O(n!), Space Complexity: O(nCk)
66
*
77
*/
88

0 commit comments

Comments
 (0)