treelayout
Lay out tree or forest
Syntax
[x,y] = treelayout(parent,post)
[x,y,h,s] = treelayout(parent,post)
Description
[x,y] = treelayout(parent,post)
列出了一棵树或者一个st.父
is the vector of parent pointers, with0
for a root.post
is an optional postorder permutation on the tree nodes. If you omitpost
,treelayout
computes it.x
andy
are vectors of coordinates in the unit square at which to lay out the nodes of the tree to make a nice picture.
[x,y,h,s] = treelayout(parent,post)
also returns the height of the treeh
and the number of verticess
in the top-level separator.
Introduced before R2006a
Was this topic helpful?