My Blog List

[Leetcode Solution] Unique Binary Search Trees II

GREAT PROBLEM

Analysis

  • Using the same idea with the previous problem "Unique Binary Search Tree" this problem could be solved
  • Let f[n] denote all of the root node of the unique binary search tree with n nodes, then f[n] is a combination of all of the root as the value of i-th element with all of the possible sub-tree 

Note

Code


No comments:

Post a Comment

Enter you comment