Golang | Leetcode Golang题解之第96题不同的二叉搜索树

题目:

题解:

Go 复制代码
func numTrees(n int) int {
    C := 1
    for i := 0; i < n; i++ {
        C = C * 2 * (2 * i + 1) / (i + 2);
    }
    return C
}
相关推荐
q***75602 小时前
【Golang】——Gin 框架中间件详解:从基础到实战
中间件·golang·gin
不穿格子的程序员2 小时前
从零开始写算法——二分-搜索二维矩阵
线性代数·算法·leetcode·矩阵·二分查找
Kuo-Teng3 小时前
LeetCode 19: Remove Nth Node From End of List
java·数据结构·算法·leetcode·链表·职场和发展·list
Kuo-Teng3 小时前
LeetCode 21: Merge Two Sorted Lists
java·算法·leetcode·链表·职场和发展
元亓亓亓5 小时前
LeetCode热题100--39. 组合总和
算法·leetcode·职场和发展
2401_841495645 小时前
【LeetCode刷题】找到字符串中所有字母异位词
数据结构·python·算法·leetcode·数组·滑动窗口·找到字符串中所有字母异位词
橘颂TA5 小时前
【剑斩OFFER】算法的暴力美学——寻找数组的中心下标
算法·leetcode·职场和发展·结构与算法
py有趣5 小时前
LeetCode算法学习之鸡蛋掉落
学习·算法·leetcode
Kuo-Teng7 小时前
LeetCode 141. Linked List Cycle
java·算法·leetcode·链表·职场和发展
资深web全栈开发7 小时前
力扣2536子矩阵元素加1-差分数组解法详解
算法·leetcode·矩阵·golang·差分数组