page261.html
来自「Data Structures And Algorithms With Obje」· HTML 代码 · 共 30 行
HTML
30 行
<HTML><HEAD><TITLE>Inorder Traversal</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="tex2html4208" HREF="page262.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html4206" HREF="page258.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html4200" HREF="page260.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html4210" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H3><A NAME="SECTION009403000000000000000">Inorder Traversal</A></H3><P>The third depth-first traversal method is<em>inorder traversal</em><A NAME=15264> </A><A NAME=15265> </A>.Inorder traversal only makes sense for binary trees.Whereas preorder traversal visits the root firstand postorder traversal visits the root last,inorder traversal visits the root <em>in between</em> visiting the leftand right subtrees:<OL><LI> Traverse the left subtree; and then<LI> visit the root; and then<LI> traverse the right subtree.</OL>An inorder traversal of the tree shown in Figure <A HREF="page258.html#figtree5"><IMG ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A>visits the nodes in the following order:<P> <IMG WIDTH=333 HEIGHT=15 ALIGN=BOTTOM ALT="displaymath63213" SRC="img1099.gif" ><P><HR><A NAME="tex2html4208" HREF="page262.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html4206" HREF="page258.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html4200" HREF="page260.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html4210" 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 + =
减小字号Ctrl + -
显示快捷键?