mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-20 10:36:09 +00:00
Bug fixes and improvements (#1380)
* preorder, inorder, postorder -> pre-order, in-order, post-order * Bug fixes * Bug fixes * Update what_is_dsa.md * Sync zh and zh-hant versions * Sync zh and zh-hant versions. * Update performance_evaluation.md and time_complexity.md * Add @khoaxuantu to the landing page. * Sync zh and zh-hant versions * Add @ khoaxuantu to the landing page of zh-hant and en versions.
This commit is contained in:
@@ -30,7 +30,7 @@ function coinChangeIIDP(coins, amt) {
|
||||
return dp[n][amt];
|
||||
}
|
||||
|
||||
/* 零錢兌換 II:狀態壓縮後的動態規劃 */
|
||||
/* 零錢兌換 II:空間最佳化後的動態規劃 */
|
||||
function coinChangeIIDPComp(coins, amt) {
|
||||
const n = coins.length;
|
||||
// 初始化 dp 表
|
||||
@@ -59,6 +59,6 @@ const amt = 5;
|
||||
let res = coinChangeIIDP(coins, amt);
|
||||
console.log(`湊出目標金額的硬幣組合數量為 ${res}`);
|
||||
|
||||
// 狀態壓縮後的動態規劃
|
||||
// 空間最佳化後的動態規劃
|
||||
res = coinChangeIIDPComp(coins, amt);
|
||||
console.log(`湊出目標金額的硬幣組合數量為 ${res}`);
|
||||
|
||||
Reference in New Issue
Block a user