mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-05 11:41:22 +08:00
Bug fixes and improvements (#1348)
* Add "reference" for EN version. Bug fixes. * Unify the figure reference as "the figure below" and "the figure above". Bug fixes. * Format the EN markdown files. * Replace "" with <u></u> for EN version and bug fixes * Fix biary_tree_dfs.png * Fix biary_tree_dfs.png * Fix zh-hant/biary_tree_dfs.png * Fix heap_sort_step1.png * Sync zh and zh-hant versions. * Bug fixes * Fix EN figures * Bug fixes * Fix the figure labels for EN version
This commit is contained in:
@@ -31,7 +31,7 @@ function coinChangeDP(coins, amt) {
|
||||
return dp[n][amt] !== MAX ? dp[n][amt] : -1;
|
||||
}
|
||||
|
||||
/* 零钱兑换:状态压缩后的动态规划 */
|
||||
/* 零钱兑换:空间优化后的动态规划 */
|
||||
function coinChangeDPComp(coins, amt) {
|
||||
const n = coins.length;
|
||||
const MAX = amt + 1;
|
||||
@@ -61,6 +61,6 @@ const amt = 4;
|
||||
let res = coinChangeDP(coins, amt);
|
||||
console.log(`凑到目标金额所需的最少硬币数量为 ${res}`);
|
||||
|
||||
// 状态压缩后的动态规划
|
||||
// 空间优化后的动态规划
|
||||
res = coinChangeDPComp(coins, amt);
|
||||
console.log(`凑到目标金额所需的最少硬币数量为 ${res}`);
|
||||
|
||||
Reference in New Issue
Block a user