Created
May 7, 2014 12:54
-
-
Save honux77/215dbb546c502c25aedf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Solution { | |
| public int numTrees(int n) { | |
| int c = 1; | |
| for (int i = 2; i <= n; i++) | |
| c = 2 * (2 * i - 1) * c / (i + 1); | |
| return c; | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://oj.leetcode.com/problems/unique-binary-search-trees/