mirror of
https://github.com/krahets/hello-algo.git
synced 2026-02-11 06:35:39 +08:00
Update knapsack_problem and intro_to_dp
Fix avl_tree
This commit is contained in:
@@ -11,7 +11,7 @@ public class climbing_stairs_dp {
|
||||
public static int climbingStairsDP(int n) {
|
||||
if (n == 1 || n == 2)
|
||||
return n;
|
||||
// 初始化 dp 列表,用于存储子问题的解
|
||||
// 初始化 dp 表,用于存储子问题的解
|
||||
int[] dp = new int[n + 1];
|
||||
// 初始状态:预设最小子问题的解
|
||||
dp[1] = 1;
|
||||
|
||||
Reference in New Issue
Block a user