mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-14 16:16:06 +00:00
Fix code naming style.
This commit is contained in:
@@ -8,18 +8,18 @@ namespace hello_algo.chapter_dynamic_programming;
|
||||
|
||||
public class climbing_stairs_dfs {
|
||||
/* 搜索 */
|
||||
public int Dfs(int i) {
|
||||
public int DFS(int i) {
|
||||
// 已知 dp[1] 和 dp[2] ,返回之
|
||||
if (i == 1 || i == 2)
|
||||
return i;
|
||||
// dp[i] = dp[i-1] + dp[i-2]
|
||||
int count = Dfs(i - 1) + Dfs(i - 2);
|
||||
int count = DFS(i - 1) + DFS(i - 2);
|
||||
return count;
|
||||
}
|
||||
|
||||
/* 爬楼梯:搜索 */
|
||||
public int ClimbingStairsDFS(int n) {
|
||||
return Dfs(n);
|
||||
return DFS(n);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
Reference in New Issue
Block a user