From 9fef5cbd00bde88126d4407c913d4b5f448d5308 Mon Sep 17 00:00:00 2001 From: Yuhao Ju Date: Tue, 11 Apr 2023 11:51:41 +0800 Subject: [PATCH] =?UTF-8?q?=20update=20=20=200322.=E9=9B=B6=E9=92=B1?= =?UTF-8?q?=E5=85=91=E6=8D=A2=EF=BC=9A=E6=B7=BB=E5=8A=A0=E5=A4=8D=E6=9D=82?= =?UTF-8?q?=E5=BA=A6=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0322.零钱兑换.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/problems/0322.零钱兑换.md b/problems/0322.零钱兑换.md index 3be72565..0e3947da 100644 --- a/problems/0322.零钱兑换.md +++ b/problems/0322.零钱兑换.md @@ -133,6 +133,11 @@ public: }; ``` +* 时间复杂度: O(n * amount),其中 n 为 coins 的长度 +* 空间复杂度: O(amount) + + + 对于遍历方式遍历背包放在外循环,遍历物品放在内循环也是可以的,我就直接给出代码了 ```CPP @@ -154,6 +159,8 @@ public: } }; ``` +* 同上 + ## 总结