From 02cb0fec20ed5582aa3ee5b76392b8bf76ca3ada Mon Sep 17 00:00:00 2001 From: swensun <1416316137@qq.com> Date: Mon, 5 Feb 2018 09:34:50 +0800 Subject: [PATCH 1/2] fix factor_combinations --- backtrack/factor_combinations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backtrack/factor_combinations.py b/backtrack/factor_combinations.py index de02b4cef..0eb6fe147 100644 --- a/backtrack/factor_combinations.py +++ b/backtrack/factor_combinations.py @@ -43,7 +43,7 @@ def getFactors(self, n): while i * i <= n: if n % i == 0: combis.append(combi + [i, n/i]), - todo.append(n/i, i, combi+[i]), + todo.append( [n / i, i, combi+[i] ] ) # python3: n // i i += 1 return combis From 315abd081ed8892087a3439f7c60694d41ad1391 Mon Sep 17 00:00:00 2001 From: swensun <1416316137@qq.com> Date: Mon, 5 Feb 2018 09:55:55 +0800 Subject: [PATCH 2/2] update readme --- README.md | 2 +- README_CN.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0fd81d06d..4ea17af72 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Minimal and clean example implementations of data structures and algorithms in P - [backtrack](backtrack) - [general_solution.md](backtrack/) - [anagram](backtrack/anagram.py) - - [array_sum_combinations](backtrack/array_sum_combination.py) + - [array_sum_combinations](backtrack/array_sum_combinations.py) - [combination_sum](backtrack/combination_sum.py) - [expression_add_operators](backtrack/expression_add_operators.py) - [factor_combinations](backtrack/factor_combinations.py) diff --git a/README_CN.md b/README_CN.md index 700f367d5..10930ea02 100644 --- a/README_CN.md +++ b/README_CN.md @@ -23,7 +23,7 @@ python版数据结构和算法实现的简约版小示例 - [backtrack:回溯](backtrack) - [general_solution.md:一般方法](backtrack/) - [anagram:同字母异序词](backtrack/anagram.py) - - [array_sum_combinations:数组和](backtrack/array_sum_combination.py) + - [array_sum_combinations:数组和](backtrack/array_sum_combinations.py) - [combination_sum:和的合并](backtrack/combination_sum.py) - [expression_add_operators:给表达式添加运算符](backtrack/expression_add_operators.py) - [factor_combinations:因素组合](backtrack/factor_combinations.py) @@ -211,4 +211,5 @@ python版数据结构和算法实现的简约版小示例 - [trie:字典](tree/trie/trie.py) - [union-find:并查集](union-find) - [count_islands:岛计数](union-find/count_islands.py) +- [或者可以用不同语言来完成上述算法,期待加入](https://github.com/yunshuipiao/sw-algorithms)