Skip to content

Commit

Permalink
[DFS] fix Space Complexity of Combination I, II, III
Browse files Browse the repository at this point in the history
  • Loading branch information
Yi Gu committed Jul 1, 2016
1 parent 117c665 commit fb1d6bf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DFS/CombinationSum.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Question Link: https://leetcode.com/problems/combination-sum/
* Primary idea: Classic Depth-first Search
*
* Time Complexity: O(n^n), Space Complexity: O(n^n)
* Time Complexity: O(n^n), Space Complexity: O(2^n - 1)
*
*/

Expand Down
2 changes: 1 addition & 1 deletion DFS/combinationSumII.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Question Link: https://leetcode.com/problems/combination-sum-ii/
* Primary idea: Classic Depth-first Search
*
* Time Complexity: O(n!), Space Complexity: O(n!)
* Time Complexity: O(n!), Space Complexity: O(2^n - 2)
*
*/

Expand Down
2 changes: 1 addition & 1 deletion DFS/combinationSumIII.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Question Link: https://leetcode.com/problems/combination-sum-iii/
* Primary idea: Classic Depth-first Search
*
* Time Complexity: O(n!), Space Complexity: O(n!)
* Time Complexity: O(n!), Space Complexity: O(nCk)
*
*/

Expand Down

0 comments on commit fb1d6bf

Please sign in to comment.