chapter_dynamic_programming/unbounded_knapsack_problem/ #595
Replies: 13 comments 19 replies
-
老师 您好,想请教下,在LeetCode上有个:可以凑成总金额所需的 最少的硬币个数 问题,它动态方程为: |
Beta Was this translation helpful? Give feedback.
-
哈喽,老师,想请教下
总金额为0,感觉应该是没有组合能凑出来,这个1的意思是是空组合吗? |
Beta Was this translation helpful? Give feedback.
-
零钱兑换问题:优化主体是硬币数量而非商品价值,因此在选中硬币时执行+1即可 |
Beta Was this translation helpful? Give feedback.
-
感觉可以增加下:背包类问题的物品和背包遍历的先后性 |
Beta Was this translation helpful? Give feedback.
-
老师,编辑距离问题的时候,步数是要+1的,这里为什么不用+1? |
Beta Was this translation helpful? Give feedback.
-
coins[i - 1] > a 为什么不是 coins[i - 1] != a 呢?恰巧能凑出来金额a的值,才能选择用不选择当前硬币+选择当前硬币的吗? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
那零钱兑换问题II能不能用类似爬楼梯的思想呢?面值就是爬的步数,target就是层数。 |
Beta Was this translation helpful? Give feedback.
-
作者能否再讲一个背包问题前k优解的问题,我看别人的代码有点看不懂 |
Beta Was this translation helpful? Give feedback.
-
如果最小面值是0.5元,amt+1就不是MAX |
Beta Was this translation helpful? Give feedback.
-
请问对于零钱兑换问题的空间优化为什么要dp = [MAX] * (amt + 1)呢 |
Beta Was this translation helpful? Give feedback.
-
零钱兑换问题2; |
Beta Was this translation helpful? Give feedback.
-
##关于背包问题的遍历顺序有着疑问 |
Beta Was this translation helpful? Give feedback.
-
chapter_dynamic_programming/unbounded_knapsack_problem/
动画图解、一键运行的数据结构与算法教程
https://www.hello-algo.com/chapter_dynamic_programming/unbounded_knapsack_problem/
Beta Was this translation helpful? Give feedback.
All reactions