📄 page255.html
字号:
<HTML><HEAD><TITLE>Alternate Representations for Trees</TITLE></HEAD><BODY bgcolor="#FFFFFF"> <a href="../index.html" target="_top"><img src="../icons/usins.gif" alt="Logo" align=right></a><b>Data Structures and Algorithms with Object-Oriented Design Patterns in Python</b><br><A NAME="tex2html4138" HREF="page256.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html4136" HREF="page252.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html4132" HREF="page254.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html4140" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H3><A NAME="SECTION009103000000000000000">Alternate Representations for Trees</A></H3><P>Figure <A HREF="page255.html#figtree2"><IMG ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A> shows an alternate representation ofthe tree <IMG WIDTH=14 HEIGHT=22 ALIGN=MIDDLE ALT="tex2html_wrap_inline62791" SRC="img1048.gif" > defined in Equation <A HREF="page252.html#eqntreestc"><IMG ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A>.In this case,the tree is represented as a set of nested regions in the plane.In fact, what we have is a <em>Venn diagram</em><A NAME=14497> </A>which corresponds to the view that a tree is a set of sets.<P><P><A NAME="14659"> </A><A NAME="figtree2"> </A> <IMG WIDTH=575 HEIGHT=209 ALIGN=BOTTOM ALT="figure14498" SRC="img1063.gif" ><BR><STRONG>Figure:</STRONG> An alternate graphical representation for trees.<BR><P><P>This hierarchical, set-within-a-set view of treesis also evoked by considering the nested structure of computer programs.For example, consider the following fragment of Python code:<PRE>class D: class E: class F: pass class G: class H: class I: pass class J: class K: pass class L: pass class M: pass</PRE>The nesting structure of this programand the tree given in Equation <A HREF="page252.html#eqntreestc"><IMG ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A>are <em>isomorphic</em><A NAME=14664> </A>.<A NAME="tex2html442" HREF="footnode.html#14665"><IMG ALIGN=BOTTOM ALT="gif" SRC="../icons/foot_motif.gif"></A>Therefore, it is not surprising that trees have an importantrole in the analysis and translation of computer programs.<P><HR><A NAME="tex2html4138" HREF="page256.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html4136" HREF="page252.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html4132" HREF="page254.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html4140" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <P><ADDRESS><img src="../icons/bruno.gif" alt="Bruno" align=right><a href="../copyright.html">Copyright © 2003</a> by <a href="../signature.html">Bruno R. Preiss, P.Eng.</a> All rights reserved.</ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -