The question mentioned "OJ's Binary Tree Serialization" :
For example: "{1,2,3,#,#,4,#,#,5}"
So when I was trying to solve this question, I got an idea!
#Unique Binary Search Trees III
It's similar to Unique Binary Search Trees II, but the return value should be a vector<string
(or vector<int>
)
##given n = 3
##your answer will be:

"1#3##2#"
//{1,0,3,0,0,2,0}

"32#1###"
//{3,2,0,1,0,0,0}

"31##2##"
//{3,1,0,0,2,0,0}

"213####"
//{2,1,3,0,0,0,0}

"1#2###3"
//{1,0,2,0,0,0,3}
#C++
class Solution {
public:
vector<vector<int> or string> generateTrees(int n) {
}
}
###If we create Tree first and then trans it into string. it's easy.
##But if we don't use struct TreeNode
, how to solve it?
###One problem is: the return value will be quite long.
####if n = 10, string.length() will be 2^10