-
Notifications
You must be signed in to change notification settings - Fork 30
/
UniqueBinarySearchTreesII.cs
executable file
·43 lines (40 loc) · 2.28 KB
/
UniqueBinarySearchTreesII.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Source : https://leetcode.com/problems/unique-binary-search-trees-ii
// Author : codeyu
// Date : Thursday, March 9, 2017 11:29:23 PM
/**********************************************************************************
*
* Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n.
*
*
* For example,
* Given n = 3, your program should return all 5 unique BST's shown below.
*
*
* 1 3 3 2 1
* \ / / / \ \
* 3 2 1 1 3 2
* / / \ \
* 2 1 2 3
*
*
*
**********************************************************************************/
using System;
using System.Collections.Generic;
using Algorithms.Utils;
namespace Algorithms
{
/**
* Definition for a binary tree node.
* public class TreeNode {
* public int val;
* public TreeNode left;
* public TreeNode right;
* public TreeNode(int x) { val = x; }
* }
*/
public class Solution095 {
public static IList<TreeNode> GenerateTrees(int n) {
throw new NotImplementedException("TODO");
}
}}