mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 19:44:45 +08:00
update 0322.零钱兑换:添加复杂度分析
This commit is contained in:
@ -133,6 +133,11 @@ public:
|
||||
};
|
||||
```
|
||||
|
||||
* 时间复杂度: O(n * amount),其中 n 为 coins 的长度
|
||||
* 空间复杂度: O(amount)
|
||||
|
||||
|
||||
|
||||
对于遍历方式遍历背包放在外循环,遍历物品放在内循环也是可以的,我就直接给出代码了
|
||||
|
||||
```CPP
|
||||
@ -154,6 +159,8 @@ public:
|
||||
}
|
||||
};
|
||||
```
|
||||
* 同上
|
||||
|
||||
|
||||
## 总结
|
||||
|
||||
|
Reference in New Issue
Block a user