algorithm - Construct a Tree -


How do I build a tree, so that the inside and the preder are transverse? I'm just searching for a skilled algorithm.

A clear copy and paste:

< Strong> Question:
p_1 , p_2 ... p_n poster should be transverse and i_1 , i_2 ... i_n Inverters can be traversal from postorder traversal They are the root of the tree, p_n find this element in Insider Traversal, i_1 , i_2 ... < Code> i_k-1 say p_n i_k + 1 ... i_n . From Inner Travelers we find all the elements in the left subsection, i.e. i_1 , i_2 ... i_k-1 and in the correct subtree, i.e. i_k + 1 ... i_n .

element P_n (and element i_k == p_n ). Correct code in p_j in p_1 , p_2 ... p_j ... p_n-1 where p_j is an element in i_1 , i_2 . . i_k-1 . This is the root of the original tree's left subtitle. Split p_1 , p_2 ... p_j and p_j + 1 ... p_n-1 and i_1 , i_2 ... i_k-1 and < Code> i_k + 1 ... i_n . You now have two repeaters representing two sub-parts post orders and indoor traversal of the original post.

Author :.

I have applied the algorithm once more, and it worked perfectly!


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -