题目:https://leetcode.com/problems/unique-binary-search-trees-ii/
代码(github):https://github.com/illuz/leetcode
求 {1, 2, ..., n} 的所有 BST。
递归即可。
理解了“Unique Binary Search Trees”后应该不难解出这题。
Java 和 Python 的解法和 C++ 一样,这里就不写出。
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||
题目:https://leetcode.com/problems/unique-binary-search-trees-ii/
代码(github):https://github.com/illuz/leetcode
求 {1, 2, ..., n} 的所有 BST。
递归即可。
理解了“Unique Binary Search Trees”后应该不难解出这题。
Java 和 Python 的解法和 C++ 一样,这里就不写出。