mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 11:34:46 +08:00
背包问题理论基础完全背包:修改Java版本代码格式化问题
This commit is contained in:
@ -177,8 +177,8 @@ int main() {
|
||||
Java:
|
||||
|
||||
```java
|
||||
//先遍历物品,再遍历背包
|
||||
private static void testCompletePack(){
|
||||
//先遍历物品,再遍历背包
|
||||
private static void testCompletePack(){
|
||||
int[] weight = {1, 3, 4};
|
||||
int[] value = {15, 20, 30};
|
||||
int bagWeight = 4;
|
||||
@ -193,10 +193,10 @@ Java:
|
||||
for (int maxValue : dp){
|
||||
System.out.println(maxValue + " ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//先遍历背包,再遍历物品
|
||||
private static void testCompletePackAnotherWay(){
|
||||
//先遍历背包,再遍历物品
|
||||
private static void testCompletePackAnotherWay(){
|
||||
int[] weight = {1, 3, 4};
|
||||
int[] value = {15, 20, 30};
|
||||
int bagWeight = 4;
|
||||
@ -211,7 +211,7 @@ Java:
|
||||
for (int maxValue : dp){
|
||||
System.out.println(maxValue + " ");
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user