mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2026-02-02 18:39:09 +08:00
更新代码块
This commit is contained in:
@@ -103,7 +103,7 @@ j相当于是头结点的元素,从1遍历到i为止。
|
||||
|
||||
代码如下:
|
||||
|
||||
```C++
|
||||
```CPP
|
||||
for (int i = 1; i <= n; i++) {
|
||||
for (int j = 1; j <= i; j++) {
|
||||
dp[i] += dp[j - 1] * dp[i - j];
|
||||
@@ -123,7 +123,7 @@ n为5时候的dp数组状态如图:
|
||||
|
||||
综上分析完毕,C++代码如下:
|
||||
|
||||
```C++
|
||||
```CPP
|
||||
class Solution {
|
||||
public:
|
||||
int numTrees(int n) {
|
||||
|
||||
Reference in New Issue
Block a user