Skip to content

Latest commit

 

History

History
8 lines (7 loc) · 284 Bytes

README.md

File metadata and controls

8 lines (7 loc) · 284 Bytes

recursion

We can use recursion to construct the tree.
We want to get all the possible roots from left subtree and right subtree.
Combine all the possible left substree and right subtree to the current root.
return the new list.

time: O(n * n * n)
space: O(height)