⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ds7.3.htm

📁 这是清华大学所用的数据结构的电子版教材
💻 HTM
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>第一章&nbsp; 绪论</title>
<meta name="Microsoft Theme" content="hounk 010">
</head>

<body background bgcolor="#000099" text="#CCCC99" link="#FF9900" vlink="#996600" alink="#FF3300">

<p align="center"><span style="mso-bidi-font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: Times New Roman; mso-hansi-font-family: Times New Roman; mso-bidi-font-family: Times New Roman; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"><b><font color="#FFFF00" size="6">7.3   
图的遍历</font></b></span></p>
<p class="MsoNormal" style="text-indent:21.0pt"><span style="font-family:宋体;
mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;"><b><font size="5" color="#FFFFFF">&nbsp;图的遍历是指从图中的任一顶点出发,对图中的所有顶点访问一次且只访问一次。图的遍历操作和树的遍历操作功能相似。图的遍历是图的一种基本操作,图的许多其它操作都是建立在遍历操作的基础之上。</font></b></span></p>
<p class="MsoNormal" style="text-indent:21.0pt"><span style="font-family:宋体;
mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;"><b><font size="5" color="#FFFFFF">由于图结构本身的复杂性,所以图的遍历操作也较复杂,主要表现在以下四个方面:</font></b></span></p>
<!--msimagelist--><table border="0" cellpadding="0" cellspacing="0" width="100%">
  <!--msimagelist--><tr>
    <!--msimagelist--><td valign="baseline" width="42"><img src="expbul1a.gif" width="15" height="15" hspace="13"></td>
    <td valign="top" width="100%">
      <p class="MsoNormal" style="text-indent: 0"><span style="font-family:宋体;
mso-hansi-font-family:&quot;Times New Roman&quot;"><b><font size="5" color="#FFFFFF">在图结构中,没有一个“自然”的首结点,图中任意一个顶点都可作为第一个被访问的结点。<span lang="EN-US"><o:p>
      </o:p>
      </span></font></b></span><!--msimagelist--></td>
  </tr>
  <!--msimagelist--><tr>
    <!--msimagelist--><td valign="baseline" width="42"><img src="expbul1a.gif" width="15" height="15" hspace="13"></td>
    <td valign="top" width="100%">
      <p class="MsoNormal" style="text-indent: 0"><span style="font-family:宋体;
mso-hansi-font-family:&quot;Times New Roman&quot;"><b><font size="5" color="#FFFFFF">在非连通图中,从一个顶点出发,只能够访问它所在的连通分量上的所有顶点,因此,还需考虑如何选取下一个出发点以访问图中其余的连通分量。<span lang="EN-US"><o:p>
      </o:p>
      </span></font></b></span><!--msimagelist--></td>
  </tr>
  <!--msimagelist--><tr>
    <!--msimagelist--><td valign="baseline" width="42"><img src="expbul1a.gif" width="15" height="15" hspace="13"></td>
    <td valign="top" width="100%">
      <p class="MsoNormal" style="text-indent: 0"><b><font size="5" color="#FFFFFF"><span style="font-family:
宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">在图结构中,如果有回路存在,那么一个顶点被访问之后,有可能沿回路又回到该顶点。</span></font></b><!--msimagelist--></td>
  </tr>
  <!--msimagelist--><tr>
    <!--msimagelist--><td valign="baseline" width="42"><img src="expbul1a.gif" width="15" height="15" hspace="13"></td>
    <td valign="top" width="100%">
      <p class="MsoNormal" style="text-indent: 0"><b><font size="5" color="#FFFFFF"><span style="font-family:
宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">在图结构中,一个顶点可以和其它多个顶点相连,当这样的顶点访问过后,存在如何选取下一个要访问的顶点的问题。</span></font></b><!--msimagelist--></td>
  </tr>
<!--msimagelist--></table>
<p class="MsoNormal" style="text-indent:21.0pt"><span style="font-family:宋体;
mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;"><b><font size="5" color="#FFFFFF">图的遍历通常有深度优先搜索和广度优先搜索两种方式,下面分别介绍。</font></b></span></p>
<h4><b><font size="5" color="#FFFFFF"><span lang="EN-US">7</span><span lang="EN-US">.3.1</span><span lang="EN-US" style="font-family:
黑体"><span style="mso-spacerun: yes">&nbsp; </span></span></font></b><b><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;"><a href="ds7.3.1.htm"><font size="5" color="#FFFF00">深度优先搜索</font></a></span></b></h4>
<h4><b><font size="5" color="#FFFFFF"><span lang="EN-US" style="font-family:
黑体"><o:p></span><span lang="EN-US">7</span><span lang="EN-US">.3.</span><span style="mso-spacerun: yes; font-family: 黑体" lang="EN-US">2&nbsp; 
</span></font></b><b><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;"><a href="ds7.3.2.htm"><font size="5" color="#FFFF00">广度优先搜索</font></a></span></b></h4>
<p class="MsoNormal"><b><font size="5" color="#FFFFFF"><span style="mso-spacerun: yes" lang="EN-US">&nbsp;&nbsp;&nbsp; 
</span></font></b></p>
<p class="MsoNormal" style="text-indent: 21.0pt" align="center"><span style="font-family:宋体;
mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;"><b><a href="ds7.htm"><font size="5" color="#FFFF00">返回</font></a></b></span></p>

</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -