Unique Binary Search Trees I
Keywords: 1-D dynamic programming.
Unique Binary Search Trees II
Build a function whose input is the range of the subtree and output is the subtrees based on this range.
vector<TreeNode*> generate(int beg, int end){
/*...*/
return ans;
}
Keywords: Bottom up.
沒有留言:
張貼留言