Closed x1957 closed 10 years ago
Unique Binary SearchTrees 时间复杂度O(n^2)
for (int i = 2; i <= n; ++i) { for (int k = 1; k <= i; ++k) f[i] += f[k-1] * f[i - k]; }
Good job!
Unique Binary SearchTrees 时间复杂度O(n^2)
for (int i = 2; i <= n; ++i) { for (int k = 1; k <= i; ++k) f[i] += f[k-1] * f[i - k]; }