95. Unique Binary Search Trees II--还未做

来源:互联网 发布:ubuntu dell 风扇控制 编辑:程序博客网 时间:2024/05/11 20:37

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
Subscribe to see which companies asked this question

0 0
原创粉丝点击