<?xml version="1.0" encoding="GBK" ?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dcterms="http://purl.org/dc/terms/">
 <channel>
  	  <title><![CDATA[阿巴睇的博客]]></title>
	  <link>http://cgbluesky.blog.163.com</link>
	  <description><![CDATA[人生一年又一年,只要每年都有所积累,有所成长,都有那么一次自己认为满意的花开时刻就好。即使一时不顺,也要敞开胸怀。生命的荣枯并不是简单的重复,一时的得失不是成败的尺度。花开不是荣耀,而是一个美丽的结束,花谢也不是耻辱,而是一个低调的开始。
 C#技术]]></description>
	  <language>zh-CN</language>
	  <pubDate>Mon, 29 Jun 2009 00:10:55 +0800</pubDate>
	  <lastBuildDate>Mon, 29 Jun 2009 00:10:55 +0800</lastBuildDate>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <generator><![CDATA[NetEase Space]]></generator>
	  <managingEditor><![CDATA[cgbluesky]]></managingEditor>
	  <webMaster><![CDATA[阿巴睇]]></webMaster>
		  <ttl>120</ttl>
	  <image>
	  	<title><![CDATA[阿巴睇的博客]]></title>
	  	<url>http://ava.bimg.126.net/photo/kRafGlrIA734cFUU_3rNWg==/186617909559646149.jpg</url>
	  	<link>http://cgbluesky.blog.163.com</link>
	  </image>
  <item>
  	<title><![CDATA[《数据结构(C#语言描述)》多媒体课件完全版]]></title>	
    <link>http://cgbluesky.blog.163.com/blog/static/2412355820095290033230</link>
    <description><![CDATA[<div><P>这段时间比较忙，不过还是把所有PPT给做完了。最主要的还是制作了Hashtable的Silverlight动态演示程序，可到以下网址观看：<A href="http://www.cnblogs.com/abatei/archive/2009/06/23/1509790.html">http://www.cnblogs.com/abatei/archive/2009/06/23/1509790.html</A></P>
<P>KMP算法和排序这一章没有制作动画，得象我视频那样用手来演示，因为这些算法做起动画来太复杂，而且效果也不见得会比用手演示好。</P>
<P>总的来说这套PPT还是很强大的，里面大量使用了动画及演示程序，给授课老师省不少事。可到以下地址下载全套PPT</P>
<P><A href="http://pickup.mofile.com/9184950848373974">http://pickup.mofile.com/9184950848373974</A></P></div>]]></description>
	    <author><![CDATA[阿巴睇]]></author>
	    <comments>http://cgbluesky.blog.163.com/blog/static/2412355820095290033230</comments>
    <slash:comments>0</slash:comments>
    <guid isPermaLink="true">http://cgbluesky.blog.163.com/blog/static/2412355820095290033230</guid>
    <pubDate>Mon, 29 Jun 2009 00:00:33 +0800</pubDate>
    <dcterms:modified>2009-06-29T00:04:21+08:00</dcterms:modified>
  </item>    
  <item>
  	<title><![CDATA[重写俄罗斯方块]]></title>	
    <link>http://cgbluesky.blog.163.com/blog/static/241235582009514111726176</link>
    <description><![CDATA[<div><P>这段时间有机会使用俄罗斯方块授课，一直对之前所做的俄罗斯方块很不满意，所以这次并无使用之前的代码。</P>
<P>由于对于俄罗斯方块所使用的数据结构和算法已了然于胸，所以所有代码均在课堂上完成，这种以蜗牛速度写代码的方式感觉很不错。今天终于把一个最简单的俄罗斯方块完成， 看了下程序，我被雷倒了，一共只用了320行代码。大大出乎我的意料，第一个俄罗斯方块使用了2800行的代码，之前一直认为做个最简单的怎么也得800行以上的代码。呵呵，对比了一下之前的俄罗斯方块，突然发现第一版是那么地丑陋。</P>
<P>第二版俄罗斯方块使用和第一版相同的数据结构，算法方面只更改了消除满行算法，这个算法是一个O(n)算法，比之前的实现漂亮多了，睡觉的时候想出来的，呵呵。</P>
<P>第二版最大的改进是把所有复杂的不该用的东西全部去掉，简单就是美。这个程序对于刚学C#的同学来说还是比较适合的，使用了并不复杂的技术实现了一个游戏，强化了初学者对于循环、判断、数组等这些最基础知识的理解和使用。</P>
<P>下载地址：<A href="http://files.cnblogs.com/abatei/Tetris.rar">http://files.cnblogs.com/abatei/Tetris.rar</A></P>
<P>代码用VS2008打开过再发上去的，使用VS2005打开的方法是：新建一个新工程，在资源管理器中删掉相应文件，然后把新文件引入即可。</P></div>]]></description>
	    <author><![CDATA[阿巴睇]]></author>
	    <comments>http://cgbluesky.blog.163.com/blog/static/241235582009514111726176</comments>
    <slash:comments>2</slash:comments>
    <guid isPermaLink="true">http://cgbluesky.blog.163.com/blog/static/241235582009514111726176</guid>
    <pubDate>Sun, 14 Jun 2009 23:17:26 +0800</pubDate>
    <dcterms:modified>2009-06-15T07:19:37+08:00</dcterms:modified>
  </item>    
  <item>
  	<title><![CDATA[《C#程序设计基础教程与实训》已经重印，并修改了错误]]></title>	
    <link>http://cgbluesky.blog.163.com/blog/static/241235582009425111225468</link>
    <description><![CDATA[<div>今天从北大出版社收到了重印的《C#程序设计基础教程与实训》，勘误中所列的所有错误在重印后均已修改。之前这本书网上缺货，现在能买到的书应该是修改后的重印版本。</div>]]></description>
	    <author><![CDATA[阿巴睇]]></author>
	    <comments>http://cgbluesky.blog.163.com/blog/static/241235582009425111225468</comments>
    <slash:comments>6</slash:comments>
    <guid isPermaLink="true">http://cgbluesky.blog.163.com/blog/static/241235582009425111225468</guid>
    <pubDate>Mon, 25 May 2009 23:12:25 +0800</pubDate>
    <dcterms:modified>2009-05-25T23:12:25+08:00</dcterms:modified>
  </item>    
  <item>
  	<title><![CDATA[《数据结构（C#语言描述）》多媒体课件2-5章]]></title>	
    <link>http://cgbluesky.blog.163.com/blog/static/241235582009419114045621</link>
    <description><![CDATA[<div><P>第6章没做完,先传前5章上来供大家学习，并提出修改意见。</P>
<P>由于打算使用Silverlight做一个Hashtable动画，可能后面几章需要花较多时间。现在还没想好到底是弄像红黑树那样的动画（实在太痛苦了），还是只是做本书中Directionary那样的实时图形。不过肯定会在下个学期开学前弄完所有多媒体课件。</P>
<P>第4章KMP算法由于太复杂没有制作动画，教师需要像我在视频中讲课那样使用手制造动画，其实效果是一样的</P>
<P>下载地址：</P>
<P><A href="http://files.cnblogs.com/abatei/chapter2-5-ppt.rar">http://files.cnblogs.com/abatei/chapter2-5-ppt.rar</A></P></div>]]></description>
	    <author><![CDATA[阿巴睇]]></author>
	    <comments>http://cgbluesky.blog.163.com/blog/static/241235582009419114045621</comments>
    <slash:comments>1</slash:comments>
    <guid isPermaLink="true">http://cgbluesky.blog.163.com/blog/static/241235582009419114045621</guid>
    <pubDate>Tue, 19 May 2009 23:40:45 +0800</pubDate>
    <dcterms:modified>2009-05-22T12:54:16+08:00</dcterms:modified>
  </item>    
  <item>
  	<title><![CDATA[《数据结构（C#语言描述）》多媒体课件(5月5日更新：第二章已完成)]]></title>	
    <link>http://cgbluesky.blog.163.com/blog/static/2412355820094105310727</link>
    <description><![CDATA[<div><P>5月5日</P>
<P>今天终于把第2章的PPT制作完成，这一章可能是最复杂的了，完成真不容易。发上来给大家共享，在看书时配合PPT里的动画会更容易理解书本内容，最下方下载地址已更新。</P>
<P>5月1日</P>
<P>今天编辑打电话来，让我做新书的PPT。为了让使用这本书授课的教师能更舒服地授课，我决定亲自上阵，制作精美、强大的多媒体课件。</P>
<P>由于数据结构这门课的特殊性，我决定大量使用动画。之前做配套视频时已经制作了部分动画，但还远远不够。这次的工程十分浩大，今天我先做了第二章的一部分课件，发上来给大家提提意见。</P>
<P>下载地址：<A href="http://files.cnblogs.com/abatei/chapter2-5-ppt.rar">http://files.cnblogs.com/abatei/chapter2-5-ppt.rar</A></P></div>]]></description>
	    <author><![CDATA[阿巴睇]]></author>
	    <comments>http://cgbluesky.blog.163.com/blog/static/2412355820094105310727</comments>
    <slash:comments>3</slash:comments>
    <guid isPermaLink="true">http://cgbluesky.blog.163.com/blog/static/2412355820094105310727</guid>
    <pubDate>Fri, 1 May 2009 00:53:10 +0800</pubDate>
    <dcterms:modified>2009-05-22T22:53:18+08:00</dcterms:modified>
  </item>    
  <item>
  	<title><![CDATA[《数据结构(C#语言描述)》勘误]]></title>	
    <link>http://cgbluesky.blog.163.com/blog/static/24123558200932235141736</link>
    <description><![CDATA[<div><P>如发现本书的错误，请在这里留言</P>
<P><STRONG>1.&nbsp; P21页例2-1第22行代码</STRONG></P>
<P>Console.Write(i+"&nbsp; ");</P>
<P>改为:</P>
<P>Console.Write(<FONT color=#ff0000>arr[i]</FONT>+"&nbsp; ");</P>
<P><STRONG>2. P37页最后一段第一行</STRONG></P>
<P>C#中实现了双向链表的数据集合是泛型集合System</P>
<P>改为:</P>
<P>C#中实现了双向链表的数据<FONT color=#ff0000>结构</FONT>是泛型集合<FONT color=#ff0000>类</FONT>System</P>
<P><STRONG>3. P8页第一行</STRONG></P>
<P>3n+2&nbsp; 改为：3n+<FONT color=#ff0000>3</FONT></P>
<P><FONT color=#000000><STRONG>4. P8页第二自然段</STRONG></FONT></P>
<P>j=0执行1次，。。。。。。最后得出上述算法所包含的基本操作的次数是3n^2+3n+4。</P>
<P>改为：</P>
<P>j=0执行<FONT color=#ff0000>n</FONT>次，。。。。。。最后得出上述算法所包含的基本操作的次数是3n^2+3n+<FONT color=#ff0000>3</FONT>。</P>
<P><STRONG>5.P95页图5.13</STRONG></P>
<P>结点C旁边的D(1)改为<FONT color=#ff0000>C(1)</FONT></P></div>]]></description>
	    <author><![CDATA[阿巴睇]]></author>
	    <comments>http://cgbluesky.blog.163.com/blog/static/24123558200932235141736</comments>
    <slash:comments>13</slash:comments>
    <guid isPermaLink="true">http://cgbluesky.blog.163.com/blog/static/24123558200932235141736</guid>
    <pubDate>Wed, 22 Apr 2009 15:51:41 +0800</pubDate>
    <dcterms:modified>2009-06-04T16:23:58+08:00</dcterms:modified>
  </item>    
  <item>
  	<title><![CDATA[《数据结构 C#语言描述》的意见和建议]]></title>	
    <link>http://cgbluesky.blog.163.com/blog/static/24123558200932235010101</link>
    <description><![CDATA[<div>关于本书，读者有何意见和建议，请在这里留言</div>]]></description>
	    <author><![CDATA[阿巴睇]]></author>
	    <comments>http://cgbluesky.blog.163.com/blog/static/24123558200932235010101</comments>
    <slash:comments>15</slash:comments>
    <guid isPermaLink="true">http://cgbluesky.blog.163.com/blog/static/24123558200932235010101</guid>
    <pubDate>Wed, 22 Apr 2009 15:50:10 +0800</pubDate>
    <dcterms:modified>2009-04-22T15:50:10+08:00</dcterms:modified>
  </item>    
  <item>
  	<title><![CDATA[《数据结构--C#语言描述》终于可在当当网购买到]]></title>	
    <link>http://cgbluesky.blog.163.com/blog/static/24123558200931804112866</link>
    <description><![CDATA[<div><P>等了这么久，今天终于等到新书可以在当当网购买到了。因为这个星期光盘才出来，现在就能买到了，有点出乎我的意料。值得庆贺</P>
<P>在当当网买书免运费，并且可以送货上门，货到付款，有需要的读者可以在以下链接购买</P>
<P><A href="http://product.dangdang.com/product.aspx?product_id=20544747">http://product.dangdang.com/product.aspx?product_id=20544747</A></P></div>]]></description>
	    <author><![CDATA[阿巴睇]]></author>
	    <comments>http://cgbluesky.blog.163.com/blog/static/24123558200931804112866</comments>
    <slash:comments>16</slash:comments>
    <guid isPermaLink="true">http://cgbluesky.blog.163.com/blog/static/24123558200931804112866</guid>
    <pubDate>Sat, 18 Apr 2009 00:41:12 +0800</pubDate>
    <dcterms:modified>2009-04-18T00:41:45+08:00</dcterms:modified>
  </item>    
  <item>
  	<title><![CDATA[《数据结构（C#语言描述）》目录]]></title>	
    <link>http://cgbluesky.blog.163.com/blog/static/241235582009213111918973</link>
    <description><![CDATA[<div><P style="MARGIN: 0cm 0cm 0pt 37.5pt; TEXT-INDENT: -37.5pt; mso-list: l1 level1 lfo1; tab-stops: list 37.5pt"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-bidi-font-family: 宋体"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">先把这本书的目录发上来，样章等书出版后再发，另外之前也发布过一集二叉树的非递归遍历算法视频给大家试看，新的下载地址如下：</FONT></SPAN></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt 37.5pt; TEXT-INDENT: -37.5pt; mso-list: l1 level1 lfo1; tab-stops: list 37.5pt"><SPAN lang=EN-US style="mso-bidi-font-family: 宋体"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman"><FONT face=Arial><A href="http://www.fileupyours.com/files/219335/5-2.swf"></A><A href="http://www.fileupyours.com/files/219335/5-2.swf">http://www.fileupyours.com/files/219335/5-2.swf</A><A href="http://www.fileupyours.com/view/219335/5-2.swf" target=_blank><SPAN lang=EN-US style="mso-bidi-font-family: 宋体"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman"><FONT face=Arial></FONT></FONT></SPAN></SPAN></A></FONT><A href="http://www.fileupyours.com/files/219335/5-2.swf"></A></FONT></SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 37.5pt; TEXT-INDENT: -37.5pt; mso-list: l1 level1 lfo1; tab-stops: list 37.5pt"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-bidi-font-family: 宋体"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman"></FONT></SPAN></SPAN></B>&nbsp;</P>
<P style="MARGIN: 0cm 0cm 0pt 37.5pt; TEXT-INDENT: -37.5pt; mso-list: l1 level1 lfo1; tab-stops: list 37.5pt"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-bidi-font-family: 宋体"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">第1章<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">绪论</SPAN><SPAN lang=EN-US></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">1.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">什么是数据结构</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level3 lfo2; tab-stops: list 36.0pt"><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">1.1.1<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;</SPAN></SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">数据结构的产生与发展</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level3 lfo2; tab-stops: list 36.0pt"><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">1.1.2<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;</SPAN></SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">数据和数据结构</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level3 lfo2; tab-stops: list 36.0pt"><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">1.1.3<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;</SPAN></SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">数据的逻辑结构</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level3 lfo2; tab-stops: list 36.0pt"><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">1.1.4<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;</SPAN></SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">数据的存储结构</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">1.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">算法与算法分析</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level3 lfo2; tab-stops: list 36.0pt"><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">1.1.5<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;</SPAN></SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">算法</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level3 lfo2; tab-stops: list 36.0pt"><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">1.1.6<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;</SPAN></SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">算法设计的目标</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level3 lfo2; tab-stops: list 36.0pt"><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">1.1.7<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;</SPAN></SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">算法的时间复杂度</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level3 lfo2; tab-stops: list 36.0pt"><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">1.1.8<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;</SPAN></SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">算法的空间复杂度</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">1.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本章小结</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">1.4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">习题</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">&nbsp;</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 37.5pt; TEXT-INDENT: -37.5pt; mso-list: l1 level1 lfo1; tab-stops: list 37.5pt"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-bidi-font-family: 宋体"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">第2章<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">线性表</SPAN><SPAN lang=EN-US></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">2.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">线性表的定义</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">2.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">线性表的顺序存储结构</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">---</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">顺序表</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US><FONT face="Times New Roman">2.2.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">顺序表的特点</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US><FONT face="Times New Roman">2.2.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">数组</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>2-1</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US><FONT face="Times New Roman">2.2.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">剖析</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">System.Collections.ArrayList</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>2-2</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US><FONT face="Times New Roman">2.2.4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类型安全</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">2.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">线性表的链式存储结构</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">---</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">链表</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">2.3.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">单向链表</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>2-3</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">2.3.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">循环链表</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>2-4</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">2.3.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">双向链表</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>2-5</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">2.4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本章小结</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">2.5 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实训指导：虚拟线性表</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>2-6</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">2.6 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">习题</SPAN><SPAN lang=EN-US><FONT face="Times New Roman"> </FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">&nbsp;</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">3</FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">章</SPAN><SPAN lang=EN-US><SPAN style="mso-spacerun: yes"><FONT face="Times New Roman">&nbsp; </FONT></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">栈和队列</SPAN><SPAN lang=EN-US></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">3.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">栈</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">3.1.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">栈的概念及操作</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">3.1.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">剖析</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">System.Collections.Stack</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>3-1</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">3.1.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">栈的应用</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>3-2</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">3.1.4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">双向栈</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">3.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">队列</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">3.2.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">队列的概念及操作</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">3.2.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">循环队列</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">3.2.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">剖析</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">System.Collections.Queue</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>3-3</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">3.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本章小结</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">3.4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实训指导：虚拟循环队列</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>3-4</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">3.5 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">习题</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">&nbsp;</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">4</FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">章</SPAN><SPAN lang=EN-US><SPAN style="mso-spacerun: yes"><FONT face="Times New Roman">&nbsp; </FONT></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">串</SPAN><SPAN lang=EN-US></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">4.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">串的基本概念</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">4.2 String</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">4.3 System.Text.StringBuilder</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">4.4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">串的模式匹配</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">4.4.1 Brute-Force</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">算法</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>4-1</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">4.4.2 KMP</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">算法</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>4-2</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>4-3</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">4.5 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本章小结</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">4.6 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实训指导：求最长公共子串</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>4-4</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">4.7 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">习题</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">&nbsp;</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">5</FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">章</SPAN><SPAN lang=EN-US><SPAN style="mso-spacerun: yes"><FONT face="Times New Roman">&nbsp; </FONT></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">树</SPAN><SPAN lang=EN-US></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">树的基本概念</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.1.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">树的定义</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.1.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">树的表示</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.1.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">树的基本术语</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二叉树</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.2.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二叉树的基本概念</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.2.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二叉树的存储结构</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二叉树的遍历</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.3.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二叉树的深度优先遍历</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>5-1</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.3.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二叉树的广度优先遍历</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>5-2</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">线索二叉树</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.4.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">线索二叉树的定义</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.4.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中序线索二叉树</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>5-3</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.5 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">树和森林</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.5.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">树的存储结构</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.5.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">森林、树、二叉树的相互转换</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>5-4</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.6 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可绘制二叉树的设计</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.6.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二叉树的结点的位置关系</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.6.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">接口设计</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.6.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二叉树绘制类的设计</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.6.4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实现可绘制二叉树</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.7 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二叉树的画树算法</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.7.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">满二叉树画法</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>5-5</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.7.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">界内画法</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.7.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">最小面积画法</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.8 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本章小结</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.9 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实训指导：虚拟二叉树</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>5-6</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">5.10 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">习题</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">&nbsp;</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">6</FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">章</SPAN><FONT face="Times New Roman"> </FONT></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图</SPAN><SPAN lang=EN-US></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">基本概念和术语</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图的存储结构</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.2.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">邻接矩阵表示法</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.2.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">邻接表表示法</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图的遍历</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.3.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">深度优先搜索遍历</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.3.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">广度优先搜索遍历</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.3.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">非连通图的遍历</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">生成树和最小生成树</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.4.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">生成树</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.4.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">最小生成树</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.4.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">普里姆算法</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>6-1</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.4.4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">克鲁斯卡尔算法</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>6-2</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.5 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">最短路径</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.5.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">单源点最短路径</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>6-3</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.5.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所有顶点之间的最短路径</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>6-4</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.6 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本章小结</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.7 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实训指导：迷宫最短路径问题</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>6-5</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">6.8 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">习题</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">&nbsp;</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">第</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">7</FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">章</SPAN><SPAN lang=EN-US><SPAN style="mso-spacerun: yes"><FONT face="Times New Roman">&nbsp; </FONT></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">查找</SPAN><SPAN lang=EN-US></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">7.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">查找的基本概念</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">7.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">顺序查找</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">7.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二分查找</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">7.3.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二分查找的基本原理</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>7-1</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">7.3.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二分查找的算法实现</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">7.3.3 Array.BinarySearch</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方法</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">7.3.4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">剖析</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">System.Collections.SortedList</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">7.4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分块查找</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>7-2</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">7.5 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二叉查找树</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">7.5.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二叉查找树的定义</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>7-3</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">7.5.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二叉查找树的查找</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">7.5.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二叉查找树的插入</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">7.5.4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二叉查找树的删除</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">7.5.5 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二叉查找树的代码实现</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">7.6 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本章小结</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">7.7 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实训指导：</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">Array.BinarySearch</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的使用</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">7.8 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">习题</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">&nbsp;</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 42.75pt; TEXT-INDENT: -42.75pt; mso-list: l2 level1 lfo3; tab-stops: list 42.75pt"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-bidi-font-family: 宋体"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">第8章<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">哈希表</SPAN><SPAN lang=EN-US></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">8.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">概念引入</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">8.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">构造哈希函数的方法</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">8.2.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">直接定址法</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">8.2.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">数字分析法</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">8.2.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">除留余数法</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">8.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">哈希冲突解决方法</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">8.3.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">闭散列法（开放地址法）</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">8.3.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">开散列法（链地址法）</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">8.4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">剖析</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">System.Collections.Hashtable</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>8-1</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">8.4.1 Hashtable</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的实现原理</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">8.4.2 Hashtable</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的代码实现</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">8.5 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">剖析</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">Dictionary&lt;TKey, TValue&gt;</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>8-2</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">8.5.1 Dictionary&lt;TKey, TValue&gt;</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类实现原理</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">8.5.2 Dictionary&lt;TKey, TValue&gt;</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的代码实现</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">8.6 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本章小结</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">8.7 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实训指导：虚拟哈希表</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>8-3</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">8.8 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">习题</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">&nbsp;</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 42.75pt; TEXT-INDENT: -42.75pt; mso-list: l2 level1 lfo3; tab-stops: list 42.75pt"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-bidi-font-family: 宋体"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">第9章<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">排序</SPAN><SPAN lang=EN-US></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">9.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">排序的基本概念</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">9.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">插入排序</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">9.2.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">直接插入排序</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>9-1</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">9.2.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">希尔排序</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>9-2</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">9.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">交换排序</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">9.3.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">冒泡排序</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>9-3</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">9.3.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">快速排序</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>9-4</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">9.4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">选择排序</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">9.4.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">直接选择排序</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>9-5</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">9.4.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">堆排序</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>9-6</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">9.5 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">归并排序</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>9-7</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">9.5.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二路归并排序</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN lang=EN-US><FONT face="Times New Roman">9.5.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二路归并排序的实现</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">9.6 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本章小结</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">9.7 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实训指导：使用</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">IComparer&lt;T&gt;</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">接口进行排序</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>9-8</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">9.8 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">习题</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">&nbsp;</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 42.75pt; TEXT-INDENT: -42.75pt; mso-list: l2 level1 lfo3; tab-stops: list 42.75pt"><SPAN lang=EN-US style="mso-bidi-font-family: 宋体"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">第10章<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">综合实训</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">---</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">八数码问题</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">10.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">什么是八数码问题</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">10.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">八数码问题的解析</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>10-1</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 26.25pt; mso-char-indent-count: 2.5"><SPAN lang=EN-US><FONT face="Times New Roman">10.2.1 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">从初始状态到达目标状态是否有解</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 26.25pt; mso-char-indent-count: 2.5"><SPAN lang=EN-US><FONT face="Times New Roman">10.2.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使用什么方法求解八解码问题的最优解</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 26.25pt; mso-char-indent-count: 2.5"><SPAN lang=EN-US><FONT face="Times New Roman">10.2.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如何避免重复访问一个状态</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 26.25pt; mso-char-indent-count: 2.5"><SPAN lang=EN-US><FONT face="Times New Roman">10.2.4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">怎样记录查找路径</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 26.25pt; mso-char-indent-count: 2.5"><SPAN lang=EN-US><FONT face="Times New Roman">10.2.5 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使用什么数据结构表示棋盘状态</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">10.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">设计目标</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">10.4 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">界面设计</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>10-2</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">10.5 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">代码编写</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 楷体_GB2312">视频<SPAN lang=EN-US>10-3</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>10.5.1 MoveDirection.cs</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>10.5.2 AIResult.cs</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>10.5.3 HashHelpers.cs</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>10.5.4 SimpleDictionary.cs</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 26.25pt; mso-char-indent-count: 2.5"><SPAN lang=EN-US><FONT face="Times New Roman">10.5.5 NumSwitch.cs</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 26.25pt; mso-char-indent-count: 2.5"><SPAN lang=EN-US><FONT face="Times New Roman">10.5.6 IEightNumAI.cs</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 26.25pt; mso-char-indent-count: 2.5"><SPAN lang=EN-US><FONT face="Times New Roman">10.5.7 BFS_AI.cs</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 26.25pt; mso-char-indent-count: 2.5"><SPAN lang=EN-US><FONT face="Times New Roman">10.5.8 MainForm.cs</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">10.6 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">调试运行</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT face="Times New Roman">10.7 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">思考与改进</SPAN></P></div>]]></description>
	    <author><![CDATA[阿巴睇]]></author>
	    <comments>http://cgbluesky.blog.163.com/blog/static/241235582009213111918973</comments>
    <slash:comments>6</slash:comments>
    <guid isPermaLink="true">http://cgbluesky.blog.163.com/blog/static/241235582009213111918973</guid>
    <pubDate>Fri, 13 Mar 2009 23:19:18 +0800</pubDate>
    <dcterms:modified>2009-03-14T00:04:07+08:00</dcterms:modified>
  </item>    
  <item>
  	<title><![CDATA[今天收到《数据结构（C#语言描述）》样书]]></title>	
    <link>http://cgbluesky.blog.163.com/blog/static/24123558200921310314460</link>
    <description><![CDATA[<div><P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 今天下午收到北京大学出版社的快件，《数据结构（C#语言描述）》样书寄过来了。经过漫长的等待，这本书终于是印出来了，可惜的是还不能上市，因为光盘号还没下来，现在是有书没光盘。</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 这是第二本书了，收到书时心情平静了许多，没有了当初的激动，呵呵，贴两张图出来庆祝一下。</P>
<P><A href="http://img.bimg.126.net/photo/3Knb0jQPUNFgp6I_MQCBbA==/2834734490453687531.jpg" target=_blank></A><A href="http://img.bimg.126.net/photo/h8FVrruBzpit_lLlrrAVKw==/2834734490453687532.jpg" target=_blank><IMG title="今天收到《数据结构（C语言描述）》样书 - 阿巴睇 - 阿巴睇的博客" alt="今天收到《数据结构（C语言描述）》样书 - 阿巴睇 - 阿巴睇的博客" src="http://img.bimg.126.net/photo/h8FVrruBzpit_lLlrrAVKw==/2834734490453687532.jpg"></A></P>
<P>&nbsp;</P>
<P><A href="http://img.bimg.126.net/photo/3Knb0jQPUNFgp6I_MQCBbA==/2834734490453687531.jpg" target=_blank><IMG title="今天收到《数据结构（C语言描述）》样书 - 阿巴睇 - 阿巴睇的博客" alt="今天收到《数据结构（C语言描述）》样书 - 阿巴睇 - 阿巴睇的博客" src="http://img.bimg.126.net/photo/3Knb0jQPUNFgp6I_MQCBbA==/2834734490453687531.jpg"></A></P>
<P>价格</P>
<P><A href="http://img.bimg.126.net/photo/-g11ifS51dXHiojX0YCyag==/3144919914788829745.jpg" target=_blank><IMG title="今天收到《数据结构（C语言描述）》样书 - 阿巴睇 - 阿巴睇的博客" alt="今天收到《数据结构（C语言描述）》样书 - 阿巴睇 - 阿巴睇的博客" src="http://img.bimg.126.net/photo/-g11ifS51dXHiojX0YCyag==/3144919914788829745.jpg"></A></P>
<P>《C#程序设计基础教程与实训》这本书的配套视频是书本的后续内容，而这本书的视频则完全配套本书使用。如下图，在何时观看哪一节视频，书本上都有明确指示。</P>
<P><A href="http://img.bimg.126.net/photo/KQf540ZSiTQ2edKlZt6maQ==/3981463545572696512.jpg" target=_blank><IMG title="今天收到《数据结构（C语言描述）》样书 - 阿巴睇 - 阿巴睇的博客" alt="今天收到《数据结构（C语言描述）》样书 - 阿巴睇 - 阿巴睇的博客" src="http://img.bimg.126.net/photo/KQf540ZSiTQ2edKlZt6maQ==/3981463545572696512.jpg"></A></P>
<P>之前曾经说过，AVL树和红黑树这两个内容由于是高职教材的缘故没有放到书中，这是个遗憾，不过我已经实现当初的诺言，将它们写在了博客里，请参照以下网址观看</P>
<P>AVL树：</P>
<P><A href="http://www.cnblogs.com/abatei/archive/2008/11/17/1335031.html">http://www.cnblogs.com/abatei/archive/2008/11/17/1335031.html</A></P>
<P>红黑树：</P>
<P><A href="http://www.cnblogs.com/abatei/archive/2008/12/17/1356565.html">http://www.cnblogs.com/abatei/archive/2008/12/17/1356565.html</A></P></div>]]></description>
	    <author><![CDATA[阿巴睇]]></author>
	    <comments>http://cgbluesky.blog.163.com/blog/static/24123558200921310314460</comments>
    <slash:comments>20</slash:comments>
    <guid isPermaLink="true">http://cgbluesky.blog.163.com/blog/static/24123558200921310314460</guid>
    <pubDate>Fri, 13 Mar 2009 22:03:14 +0800</pubDate>
    <dcterms:modified>2009-03-13T23:10:34+08:00</dcterms:modified>
  </item>    
  <item>
  	<title><![CDATA[C#与数据结构--树论--平衡二叉树(AVL Tree)]]></title>	
    <link>http://cgbluesky.blog.163.com/blog/static/241235582008101793150537</link>
    <description><![CDATA[<div><H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-FAMILY: 黑体; mso-ascii-font-family: Arial; mso-no-proof: yes">介绍</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></H2>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">我们知道在二叉查找树中，如果插入元素的顺序接近有序，那么二叉查找树将退化为链表，从而导致二叉查找树的查找效率大为降低。如何使得二叉查找树无论在什么样情况下都能使它的形态最大限度地接近满二叉树以保证它的查找效率呢？</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">前苏联科学家</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">G.M. Adelson-Velskii </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman"> E.M. Landis</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">给出了答案。他们在</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">1962</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">年发表的一篇名为</SPAN><SPAN style="mso-no-proof: yes"><FONT face="Times New Roman"> </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">《</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">An algorithm for the organization of information</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">》的文章中提出了一种自平衡二叉查找树（</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><A title="Self-balancing binary search tree" href="http://en.wikipedia.org/wiki/Self-balancing_binary_search_tree"><SPAN style="COLOR: windowtext; TEXT-DECORATION: none; text-underline: none"><FONT face="Times New Roman">self-balancing binary search tree</FONT></SPAN></A></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">）。这种二叉查找树在插入和删除操作中，可以通过一系列的旋转操作来保持平衡，从而保证了二叉查找树的查找效率。最终这种二叉查找树以他们的名字命名为“</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL-Tree</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">”，它也被称为平衡二叉树（</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">Balanced Binary Tree</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">）。这里所说的平衡使我们想到了中庸之道，但有句话说得好，“中不偏，庸不易”。学会这种平衡术是一个相当痛苦的过程。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN style="FONT-FAMILY: 黑体; mso-ascii-font-family: Arial; mso-no-proof: yes">什么是平衡</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></H2>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">为了保证平衡，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树中的每个结点都有一个平衡因子（</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">balance factor</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，以下用</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">表示），它表示这个结点的左、右子树的高度差，也就是左子树的高度减去右子树的高度的结果值。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树上所有结点的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-bidi-font-family: 宋体">值</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">只能是</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">-1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">0</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">。反之，只要二叉树上一个结点的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的绝对值大于</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，则该二叉树就不是平衡二叉树。图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">演示了平衡二叉树和非平衡二叉树。</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'"><A href="http://img.blog.163.com/photo/lKxnw4uWZt44Q7rAfzXx9g==/890868301290260700.jpg" target=_blank><IMG title="C与数据结构--树论--平衡二叉树(AVL Tree) - 阿巴睇 - 阿巴睇的博客" alt="C与数据结构--树论--平衡二叉树(AVL Tree) - 阿巴睇 - 阿巴睇的博客" src="http://img.blog.163.com/photo/lKxnw4uWZt44Q7rAfzXx9g==/890868301290260700.jpg"></A></SPAN></P><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">
<H3 style="MARGIN: 13pt 0cm"><FONT size=5><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树的构造</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></FONT></H3>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">如何构造一棵平衡二叉树呢？动态地调整二叉查找树平衡的方法为：每插入一个结点后，首先检查是否破坏了树的平衡性，如果因插入结点而破坏了二叉查找树的平衡，则找出离插入点最近的不平衡结点，然后将该不平衡结点为根的子树进行旋转操作，我们称该不平衡结点为旋转根，以该旋转根为根的子树称为最小不平衡子树。失衡状态可归纳为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">4</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">种，它们对应着</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">4</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">种旋转类型。下面使用了</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">Flash</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">动画演示了这四种旋转类型，请确保你的电脑安装了</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">Flash8.0</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">以上版本的播放器，并且浏览器允许使用</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">Flash</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">。做这几个动画纯属好玩，希望有一天可以使用</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">Silverlight</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">做这些的动画。不过好象现在还没什么博客支持。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 42pt; VERTICAL-ALIGN: middle; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-no-proof: yes; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">LL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">型旋转</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P></EMBED>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"></P>
<P style="MARGIN: 0cm 0cm 0pt 42pt; VERTICAL-ALIGN: middle; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'"></SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P><EMBED allowScriptAccess="never" allowNetworking="internal" style="DISPLAY: block" pluginspage=http://www.macromedia.com/go/getflashplayer src=http://www.fileupyours.com/files/219335/LL%26%2322411%3B%26%2326059%3B%26%2336716%3B.swf width=350 height=300 type=application/x-shockwave-flash wmode="transparent" quality="high"  ></EMBED>&nbsp;&nbsp; 
<P></P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">如以上动画所示，插入结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">5</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">后，结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">50</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值由</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">变为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">2</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，此时结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">50</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">为旋转根。这种插入结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">50</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的左孩子的左子树而导致失衡的情况需要进行</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">LL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">旋转（</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">LL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">意为左左）。可以观察到，虽然结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">50</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值由</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">变为了</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">0</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，但最小不平衡子树在插入结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">5</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">前和旋转后的高度不变。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 42pt; VERTICAL-ALIGN: middle; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-no-proof: yes; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">RR</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">型旋转</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 42pt; VERTICAL-ALIGN: middle; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'"></SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><EMBED allowScriptAccess="never" allowNetworking="internal" style="DISPLAY: block" pluginspage=http://www.macromedia.com/go/getflashplayer src=http://www.fileupyours.com/files/219335/RR%26%2322411%3B%26%2326059%3B%26%2336716%3B.swf width=350 height=300 type=application/x-shockwave-flash wmode="transparent" quality="high"  ></EMBED>&nbsp;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">&nbsp;</P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">如以上动画所示，插入结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">90</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">后，结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">25</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值由</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">-1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">变为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">-2</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，此时结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">25</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">为旋转根。这种插入结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">25</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的右孩子的右子树而导致失衡的情况需要进行</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">RR</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">旋转。最小不平衡子树在插入结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">90</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">前和旋转后的高度不变。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 42pt; VERTICAL-ALIGN: middle; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-no-proof: yes; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">LR</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">型旋转</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><EMBED allowScriptAccess="never" allowNetworking="internal" style="DISPLAY: block" pluginspage=http://www.macromedia.com/go/getflashplayer src=http://www.fileupyours.com/files/219335/LR%28R%29%26%2322411%3B%26%2326059%3B%26%2336716%3B.swf width=350 height=300 type=application/x-shockwave-flash wmode="transparent" quality="high"  ></EMBED>&nbsp;</P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><EMBED allowScriptAccess="never" allowNetworking="internal" style="DISPLAY: block" pluginspage=http://www.macromedia.com/go/getflashplayer src=http://www.fileupyours.com/files/219335/LR%28L%29%26%2322411%3B%26%2326059%3B%26%2336716%3B.swf width=350 height=300 type=application/x-shockwave-flash wmode="transparent" quality="high"  ></EMBED>&nbsp;</P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">插入旋转根的左孩子的右子树而导致失衡的情况需要进行</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">LR</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">旋转。这里演示了</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">LR(L)</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">LR(R) </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">两种情况。插入结点前和旋转后的最小不平衡子树高度不变。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 42pt; VERTICAL-ALIGN: middle; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-no-proof: yes; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">RL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">型旋转</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">&nbsp;</P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><EMBED allowScriptAccess="never" allowNetworking="internal" style="DISPLAY: block" pluginspage=http://www.macromedia.com/go/getflashplayer src=http://www.fileupyours.com/files/219335/RL%28L%29%26%2322411%3B%26%2326059%3B%26%2336716%3B.swf width=350 height=300 type=application/x-shockwave-flash wmode="transparent" quality="high"  ></EMBED><EMBED allowScriptAccess="never" allowNetworking="internal" style="DISPLAY: block" pluginspage=http://www.macromedia.com/go/getflashplayer src=http://www.fileupyours.com/files/219335/RL%28R%29%26%2322411%3B%26%2326059%3B%26%2336716%3B.swf width=350 height=300 type=application/x-shockwave-flash wmode="transparent" quality="high"  ></EMBED>&nbsp;&nbsp;</P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">插入旋转根的右孩子的左子树而导致失衡的情况需要进行</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">RL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">旋转。这里演示了</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">RL(L)</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">RL(R) </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">两种情况。插入结点前和旋转后的最小不平衡子树高度不变。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">以上动画只演示了几种旋转类型的较复杂的情况，并没有全部演示，比如旋转根的左子树或右子树为空的情况，具体算法请参见稍后的代码。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<H3 style="MARGIN: 13pt 0cm"><FONT size=5><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树上结点的插入</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></FONT></H3>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">算法的思想理解起来还是不太困难的，但如果真要使用代码实现就没那么简单了，它拥有超高的算法实现复杂度。我查了很多资料，大部分只给出主要算法代码，对于如何回溯修改</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值，如何处理不需要旋转的情况绝口不提，甚至对删除算法直接忽略。上网找资料，中文的，英文的全找了，大部分写代码不加注释，狂汗．．．．，实在看不下去。大部分代码使用递归算法，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">C#</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">实现更是少得可怜，在国外网站找到一个，但使用了三叉链表实现，多加了一个</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">parent</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">指针，总之无法找到让人满意的代码。最后一咬牙一跺脚，自己实现。最让人头痛的莫过于如何处理插入和删除后的回溯和修改</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值，庆幸的是最终还是按照我最初的想法比较漂亮地实现了</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树。优点是：无递归；无</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">parent</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">指针；插入和删除操作使用同一旋转方法，使代码更为简化。缺点是：为了兼顾效率，有些地方的处理比较特殊，代码很难完全读懂。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">下面对本算法做原理上的介绍：</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 39pt; VERTICAL-ALIGN: middle; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo2; tab-stops: list 39.0pt"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">1、<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></FONT></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">如何回溯修改祖先结点的平衡因子</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">我们知道，在</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树上插入一个新结点后，有可能导致其他结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值的改变，哪些结点的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值会被改变？如何计算新的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值呢？要解决这些问题，我们必须理解以下几个要点：</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 42pt; VERTICAL-ALIGN: middle; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-no-proof: yes; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">只有根结点到插入结（橙色结点）点路径（称为插入路径）上的结点的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值会被改变。如图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">2</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">所示，只有插入路径上结点（灰色结点）的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值被改变，其他非插入路径上结点的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值不变。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><A href="http://img.blog.163.com/photo/YuYqlbAspHy5OiylNSUNow==/890868301290260701.jpg" target=_blank><IMG title="C与数据结构--树论--平衡二叉树(AVL Tree) - 阿巴睇 - 阿巴睇的博客" alt="C与数据结构--树论--平衡二叉树(AVL Tree) - 阿巴睇 - 阿巴睇的博客" src="http://img.blog.163.com/photo/YuYqlbAspHy5OiylNSUNow==/890868301290260701.jpg"></A></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">&nbsp;</P>
<P style="MARGIN: 0cm 0cm 0pt 42pt; VERTICAL-ALIGN: middle; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-no-proof: yes; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">当一个结点插入到某个结点的左子树时，该结点的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值加</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">（如图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">2</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">50</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">43</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">）；当一个结点插入到某个结点的右子树时，该结点的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值减</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">（如图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">2</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">25</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">30</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">）。如何在程序中判断一个结点是插入到左子树还是右子树呢？很简单，根据二叉查找树的特性可以得出结论：如果插入结点小于某个结点，则必定是插入到这个结点的左子树中；如果如果插入结点大于某个结点，则必定插入到这个结点的右子树中。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 42pt; VERTICAL-ALIGN: middle; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-no-proof: yes; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">修改</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值的操作需从插入点开始向上回溯至根结点依次进行，当路径上某个结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值修改后变为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">0</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，则修改停止。如图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">3</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">所示，插入结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">30</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">后，首先由于</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">30&lt;43</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，将结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">43</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值加</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，使得结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">43</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值由</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">0</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">变为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman"> 1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">；接下来由于</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">30&gt;25</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">25</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值由</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">改为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">0</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">；此时结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">25</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">0</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，停止回溯，不需要再修改插入路径上结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">50</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的平衡因子。道理很简单：当结点的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值由</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">或</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">-1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">变为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">0</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，表明高度小的子树添加了新结点，树的高度没有增加，所以不必修改祖先结点的平衡因子；当结点的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值由</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">0</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">变为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">或</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">-1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">时，表明原本等高左右子树由于一边变高而导致失衡，整棵子树的高度变高，所以必须向上修改祖先结点的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><A href="http://img.blog.163.com/photo/vBHt3qKi8BqAm9Nh0MHvig==/890868301290260702.jpg" target=_blank><IMG title="C与数据结构--树论--平衡二叉树(AVL Tree) - 阿巴睇 - 阿巴睇的博客" alt="C与数据结构--树论--平衡二叉树(AVL Tree) - 阿巴睇 - 阿巴睇的博客" src="http://img.blog.163.com/photo/vBHt3qKi8BqAm9Nh0MHvig==/890868301290260702.jpg"></A></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">&nbsp;</P>
<P style="MARGIN: 0cm 0cm 0pt 39pt; VERTICAL-ALIGN: middle; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 39.0pt"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">1、<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></FONT></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">何时进行旋转操作？如何判断作什么类型的旋转？</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">在回溯修改祖先结点的平衡因子时，如果碰到某个结点的平衡因子变为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">2</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">或</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">-2</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，表明</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树失衡，这时需要以该结点为旋转根，对最小不平衡子树进行旋转操作。由于是从插入点开始回溯，所以最先碰到的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值变为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">2</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">或</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">-2</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的结点必定为最小不平衡子树的根结点。如图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">4</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">所示，插入</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">39</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">后，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">43</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">50</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">两个结点的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值都会变为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">2</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，而必定先访问到结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">43</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，所以</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">43</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">是最小不平衡子树的根。根据以上</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">Flash</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">动画演示所示，旋转操作完成后，最小不平衡子树插入结点前和旋转完成后的高度不变，所以可以得出结论：旋转操作完成后，无需再回溯修改祖先的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值。这样，图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">4</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">中的结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">25</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">50</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的平衡因子实际上在插入结点操作完成后的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值不变（对比图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">2</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">）。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><A href="http://img.blog.163.com/photo/kUdj0NQZ1Ht2ZGqZGYXO2A==/3987655995060883157.jpg" target=_blank><IMG title="C与数据结构--树论--平衡二叉树(AVL Tree) - 阿巴睇 - 阿巴睇的博客" alt="C与数据结构--树论--平衡二叉树(AVL Tree) - 阿巴睇 - 阿巴睇的博客" src="http://img.blog.163.com/photo/kUdj0NQZ1Ht2ZGqZGYXO2A==/3987655995060883157.jpg"></A></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">&nbsp;</P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">可以通过旋转根及其孩子的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值来决定作什么类型的旋转操作：</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 42pt; VERTICAL-ALIGN: middle; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-no-proof: yes; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">当旋转根的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">2</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">时：</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 21pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 42pt; mso-char-indent-count: 4.0; mso-para-margin-left: 2.0gd"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">如果旋转根的左孩子的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，则进行</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">LL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">型旋转；</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 21pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 42pt; mso-char-indent-count: 4.0; mso-para-margin-left: 2.0gd"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">如果旋转根的左孩子的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">-1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，则进行</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">LR</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">型旋转。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 42pt; VERTICAL-ALIGN: middle; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-no-proof: yes; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">当旋转根的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">-2</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">时：</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 21pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 42pt; mso-char-indent-count: 4.0; mso-para-margin-left: 2.0gd"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">如果旋转根的右孩子的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，则进行</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">RL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">型旋转；</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 21pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 42pt; mso-char-indent-count: 4.0; mso-para-margin-left: 2.0gd"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">如果旋转根的右孩子的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">-1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，则进行</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">RR</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">型旋转。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">可通过观察之前的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">Flash</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">动画检验以上结论。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 39pt; VERTICAL-ALIGN: middle; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo2; tab-stops: list 39.0pt"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">1、<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></FONT></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">如何保存插入路径？</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">可以使用栈来保存插入路径上的各个结点，但由于栈是由数组抽象而来，为了进一步加快</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树的运行速度，我直接使用数组存放插入路径，这样可以减少方法的调用，尽量避免一些不必要的操作。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">如果实现</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树实现索引器，而在索引器中使用</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">int32</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，那么</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树元素的长度不会超过一个</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">32</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">位整数的最大值。一个深度为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">32</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的满二叉树可以存放结点数为：</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">2^32-1=4294967295</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，这个值已经远远超出</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">32</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">位的整数范围，所以我将数组的长度定为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">32</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">。这样就不必如</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">ArrayList</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">那样进行扩容操作了。另外本程序还使用了一个成员变量</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">p</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">用于指示当前访问结点，由于</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">p</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">指针的存在可以不必在每次进行插入和删除操作后清空数组中的元素，进一步增加了</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树的运行速度。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">使用数组的另一个好处是可以随时访问旋转根的双亲结点，以方便进行旋转操作时修改根结点。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<H3 style="MARGIN: 13pt 0cm"><FONT size=5><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树上结点的删除</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></FONT></H3>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树的删除操作与插入操作有许多相似之处，它的大体步骤如下：</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">⑴用二叉查找树的删除算法找到并删除结点（这里简称为删除点）；</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">⑵沿删除点向上回溯，必要时，修改祖先结点的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值；</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">⑶回溯途中，一旦发现某个祖先的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值失衡，如插入操作那样旋转不平衡子树使之变为平衡，跟插入操作不同的是，旋转完成后，回溯不能停止，也就是说在</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树上删除一个结点有可能引起多次旋转。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树上的删除和插入操作虽然大体相似，但还是有一些不同之处，大家需要注意以下几点：</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 39pt; VERTICAL-ALIGN: middle; TEXT-INDENT: -18pt; mso-list: l2 level1 lfo3; tab-stops: list 39.0pt"><SPAN lang=EN-US style="mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">1、<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp; </SPAN></FONT></SPAN></SPAN><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">回溯方式的不同</SPAN></B><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">在删除结点的回溯过程中，当某个结点的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值变为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">或</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">-1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">时，则停止回溯。这一点同插入操作正好相反，因为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值由</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">0</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">变为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">或</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">-1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，表明原本平衡的子树由于某个结点的删除导致了不平衡，子树的总体高度不变，所以不再需要向上回溯。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 39pt; VERTICAL-ALIGN: middle; TEXT-INDENT: -18pt; mso-list: l2 level1 lfo3; tab-stops: list 39.0pt"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">2、<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></FONT></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">旋转方式的不同</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">如图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">5</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">所示：删除</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树中的结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">25</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">导致结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">50</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值由原来的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">-1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">变为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">-2</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，但旋转根</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">50</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的右孩子的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">0</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，这种情况在前面所讲的旋转操作中并不存在，那么是需要对它进行</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">RR</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">旋转还是</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">RL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">旋转呢？正确方法是使用</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">RR</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">旋转，所不同之处是旋转后的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值不同，需要单独处理。需要注意，这种情况在插入操作时不可能发生，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">LL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">旋转也存在类型的情况。另外旋转完成后树的整体高度没有改变，所以大部分情况下旋转操作完成后，子树的高度降低，需要继续向上回溯修改祖先的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BF</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值，而只有这种情况由于子树的高度未改变，所以停止回溯。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><A href="http://img.blog.163.com/photo/I19BG2T1t89CmSMKbYFHFA==/890868301290260704.jpg" target=_blank></A></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><A href="http://img.blog.163.com/photo/BmmqqXY_HMw1HRBldxA8Sg==/856528354131671900.jpg" target=_blank></A><A href="http://img.blog.163.com/photo/BWMeVh7eaHLc7FGcxazIkg==/1137440380889072522.jpg" target=_blank><IMG title="C与数据结构--树论--平衡二叉树(AVL Tree) - 阿巴睇 - 阿巴睇的博客" alt="C与数据结构--树论--平衡二叉树(AVL Tree) - 阿巴睇 - 阿巴睇的博客" src="http://img.blog.163.com/photo/BWMeVh7eaHLc7FGcxazIkg==/1137440380889072522.jpg"></A>&nbsp;</P>
<P style="MARGIN: 0cm 0cm 0pt 39pt; VERTICAL-ALIGN: middle; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 39.0pt"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">3、<SPAN style="FONT: 7pt 'Times New Roman'"> </SPAN></FONT></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">删除点的选择特例</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></B></P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">在二叉查找树中，我们知道当删除点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">p</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">既有左子树，又有右子树，此时可以令</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">p</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">的中序遍历直接前驱结点代替</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">p</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，然后再从二叉查找树中删除它的直接前驱。如图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">7.13</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">所示，结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">5</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">既有左子树，又有右子树，它的直接前驱结点为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">4</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">。在删除结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">5</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">时，首先用结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">4</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">代替结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">5</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">，然后再删除结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">4</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">完成删除操作。这里需要注意的是此时必须将删除前的结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">4</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">作为删除点来进行向上回溯操作，而不是结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">5</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><A href="http://img.blog.163.com/photo/nKqmRMzdgKR39vQsxweBQQ==/890868301290260705.jpg" target=_blank><IMG title="C与数据结构--树论--平衡二叉树(AVL Tree) - 阿巴睇 - 阿巴睇的博客" alt="C与数据结构--树论--平衡二叉树(AVL Tree) - 阿巴睇 - 阿巴睇的博客" src="http://img.blog.163.com/photo/nKqmRMzdgKR39vQsxweBQQ==/890868301290260705.jpg"></A></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0">&nbsp;</P>
<H3 style="MARGIN: 13pt 0cm"><FONT size=5><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树的代码实现</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></FONT></H3>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">这里没有给出</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树的泛型实现，它只存放整数。因为如果使用泛型实现并按照微软惯例，使用键</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">/</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">值对实现，那么代码真的就很难读懂了。以这个代码为基础，改为泛型实现是很容易的事。另外</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">C#</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">中没</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">树的实现，而实现了红黑树，说明红黑树更有效率，所以也不必将</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AVL</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">泛型化，代码忽略了部分出错可能。红黑树将在后面讲解。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">public class BinarySearchTree : IBinaryTree //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">实现画树接口</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">{<SPAN style="mso-tab-count: 1">&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">成员变量</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>private Node _head; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">头指针</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>private Node[] path = new Node[32]; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">记录访问路径上的结点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>private int p; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">表示当前访问到的结点在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">_path</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">上的索引</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>INode IBinaryTree.Head //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">显式接口实现</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;</SPAN>get { return (INode)_head; }</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-char-indent-count: 2.0; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">public bool Add(int value) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">添加一个元素</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-char-indent-count: 2.0; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">{<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">如果是空树，则新结点成为二叉排序树的根</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (_head == null)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>_head = new Node(value);</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>_head.BF = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return true;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>p = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>//prev</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">为上一次访问的结点，</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">current</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">为当前访问结点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Node prev = null, current = _head;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>while (current != null)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>path[p++] = current; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">将路径上的结点插入数组</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">如果插入值已存在，则插入失败</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (current.Data == value)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>return false;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>prev = current;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">当插入值小于当前结点，则继续访问左子树，否则访问右子树</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>current = (value &lt; prev.Data) ? prev.Left : prev.Right;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>current = new Node(value); //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">创建新结点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>current.BF = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>if (value &lt; prev.Data) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">如果插入值小于双亲结点的值</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>prev.Left = current; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">成为左孩子</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>else //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">如果插入值大于双亲结点的值</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>prev.Right = current; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">成为右孩子</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>path[p] = current; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">将新元素插入数组</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">path</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">的最后</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">修改插入点至根结点路径上各结点的平衡因子</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>int bf = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>while (p &gt; 0)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>//bf</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">表示平衡因子的改变量，当新结点插入左子树，则平衡因子</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">+1</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">当新结点插入右子树，则平衡因子</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">-1</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>bf = (value &lt; path[p - 1].Data) ? 1 : -1;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>path[--p].BF += bf; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">改变当父结点的平衡因子</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>bf = path[p].BF; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">获取当前结点的平衡因子</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">判断当前结点平衡因子，如果为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">0</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">表示该子树已平衡，不需再回溯</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">而改变祖先结点平衡因子，此时添加成功，直接返回</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (bf == 0)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return true;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>else if (bf == 2 || bf == -2) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">需要旋转的情况</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>RotateSubTree(bf);</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return true;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return true;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">删除指定值</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>public bool Remove(int value) </SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>p = -1;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//parent</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">表示双亲结点，</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">node</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">表示当前结点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Node node = _head;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">寻找指定值所在的结点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>while (node != null)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>path[++p] = node;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">如果找到，则调用</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">RemoveNode</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">方法删除结点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (value == node.Data)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>RemoveNode(node);//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">现在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">p</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">指向被删除结点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return true; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">返回</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">true</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">表示删除成功</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (value &lt; node.Data)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">如果删除值小于当前结点，则向左子树继续寻找</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>node = node.Left;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>else</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">如果删除值大于当前结点，则向右子树继续寻找</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>node = node.Right;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return false; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">返回</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">false</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">表示删除失败</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">删除指定结点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>private void RemoveNode(Node node)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Node tmp = null;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">当被删除结点存在左右子树时</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (node.Left != null &amp;&amp; node.Right != null)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>tmp = node.Left; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">获取左子树</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>path[++p] = tmp;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>while (tmp.Right != null) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">获取</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">node</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">的中序遍历前驱结点，并存放于</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">tmp</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">中</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">找到左子树中的最右下结点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>tmp = tmp.Right;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>path[++p] = tmp;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">用中序遍历前驱结点的值代替被删除结点的值</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>node.Data = tmp.Data;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (path[p - 1] == node)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>path[p - 1].Left = tmp.Left;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>else</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>path[p - 1].Right = tmp.Left;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>else //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">当只有左子树或右子树或为叶子结点时</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">首先找到惟一的孩子结点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>tmp = node.Left;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (tmp == null) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">如果只有右孩子或没孩子</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>tmp = node.Right;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (p &gt; 0)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (path[p - 1].Left == node)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">如果被删结点是左孩子</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>path[p - 1].Left = tmp;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>else</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">如果被删结点是右孩子</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>path[p - 1].Right = tmp;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>else<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">当删除的是根结点时</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>_head = tmp;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">删除完后进行旋转，现在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">p</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">指向实际被删除的结点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>int data = node.Data;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>while (p &gt; 0)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>//bf</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">表示平衡因子的改变量，当删除的是左子树中的结点时，平衡因子</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">-1</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">当删除的是右子树的孩子时，平衡因子</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">+1</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>int bf = (data &lt;= path[p - 1].Data) ? -1 : 1;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>path[--p].BF += bf; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">改变当父结点的平衡因子</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>bf = path[p].BF; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">获取当前结点的平衡因子</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (bf != 0) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">如果</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">bf==0</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">，表明高度降低，继续后上回溯</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">如果</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">bf</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">1</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">或</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">-1</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">则说明高度未变，停止回溯，如果为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">2</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">或</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">-2</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">，则进行旋转</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">当旋转后高度不变，则停止回溯</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>if (bf == 1 || bf == -1 || !RotateSubTree(bf))</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>break;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">旋转以</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">root</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">为根的子树，当高度改变，则返回</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">true</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">；高度未变则返回</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">false</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>private bool RotateSubTree(int bf) </SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>bool tallChange = true;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Node root = path[p], newRoot = null;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (bf == 2) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">当平衡因子为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">2</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">时需要进行旋转操作</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>int leftBF = root.Left.BF;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (leftBF == -1) //LR</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">型旋转</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newRoot = LR(root);</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>else if (leftBF == 1)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newRoot = LL(root); //LL</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">型旋转</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>else //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">当旋转根左孩子的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">bf</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">0</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">时，只有删除时才会出现</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newRoot = LL(root);</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>tallChange = false;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;</SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (bf == -2) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">当平衡因子为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">-2</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">时需要进行旋转操作</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>int rightBF = root.Right.BF; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">获取旋转根右孩子的平衡因子</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (rightBF == 1) </SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newRoot = RL(root); //RL</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">型旋转</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>else if (rightBF == -1)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newRoot = RR(root); //RR</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">型旋转</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>else //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">当旋转根左孩子的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">bf</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">0</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">时，只有删除时才会出现</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newRoot = RR(root);</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>tallChange = false;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">更改新的子树根</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (p &gt; 0)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (root.Data &lt; path[p - 1].Data)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>path[p - 1].Left = newRoot;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>else</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>path[p - 1].Right = newRoot;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>else</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>_head = newRoot; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">如果旋转根为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">AVL</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">树的根，则指定新</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">AVL</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">树根结点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return tallChange;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>//root</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">为旋转根，</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">rootPrev</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">为旋转根双亲结点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>private Node LL(Node root) //LL</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">型旋转，返回旋转后的新子树根</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Node rootNext = root.Left;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>root.Left = rootNext.Right;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>rootNext.Right = root;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (rootNext.BF == 1)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>root.BF = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>rootNext.BF = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>else //rootNext.BF==0</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">的情况，删除时用</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>root.BF = 1;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>rootNext.BF = -1;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return rootNext; //rootNext</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">为新子树的根</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>private Node LR(Node root) //LR</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">型旋转，返回旋转后的新子树根</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Node rootNext = root.Left;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Node newRoot = rootNext.Right;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>root.Left = newRoot.Right;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>rootNext.Right = newRoot.Left;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newRoot.Left = rootNext;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newRoot.Right = root;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>switch (newRoot.BF) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">改变平衡因子</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>case 0:</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>root.BF = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>rootNext.BF = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>break;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>case 1:</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>root.BF = -1;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>rootNext.BF = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>break;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>case -1:</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>root.BF = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>rootNext.BF = 1;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>break;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newRoot.BF = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return newRoot; //newRoot</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">为新子树的根</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>private Node RR(Node root) //RR</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">型旋转，返回旋转后的新子树根</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Node rootNext = root.Right;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>root.Right = rootNext.Left;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>rootNext.Left = root;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (rootNext.BF == -1)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>root.BF = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>rootNext.BF = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>else //rootNext.BF==0</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">的情况，删除时用</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>root.BF = -1;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>rootNext.BF = 1;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return rootNext; //rootNext</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">为新子树的根</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>private Node RL(Node root) //RL</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">型旋转，返回旋转后的新子树根</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Node rootNext = root.Right;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Node newRoot = rootNext.Left;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>root.Right = newRoot.Left;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>rootNext.Left = newRoot.Right;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newRoot.Right = rootNext;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newRoot.Left = root;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>switch (newRoot.BF) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">改变平衡因子</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>case 0:</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>root.BF = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>rootNext.BF = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>break;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>case 1:</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>root.BF = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>rootNext.BF = -1;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>break;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>case -1:</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>root.BF = 1;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>rootNext.BF = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>break;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>newRoot.BF = 0;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return newRoot; //newRoot</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-ascii-font-family: 'Courier New'; mso-no-proof: yes; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">为新子树的根</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">运行效果如图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">7</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-no-proof: yes; mso-hansi-font-family: 'Times New Roman'">所示：</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><A href="http://img.blog.163.com/photo/vipDEMl3WEiO1RZAQgakSQ==/2607302709271799047.jpg" target=_blank><IMG title="C与数据结构--树论--平衡二叉树(AVL Tree) - 阿巴睇 - 阿巴睇的博客" alt="C与数据结构--树论--平衡二叉树(AVL Tree) - 阿巴睇 - 阿巴睇的博客" src="http://img.blog.163.com/photo/vipDEMl3WEiO1RZAQgakSQ==/2607302709271799047.jpg"></A></P></SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></div>]]></description>
	    <author><![CDATA[阿巴睇]]></author>
	    <comments>http://cgbluesky.blog.163.com/blog/static/241235582008101793150537</comments>
    <slash:comments>6</slash:comments>
    <guid isPermaLink="true">http://cgbluesky.blog.163.com/blog/static/241235582008101793150537</guid>
    <pubDate>Mon, 17 Nov 2008 09:31:50 +0800</pubDate>
    <dcterms:modified>2009-02-11T21:31:37+08:00</dcterms:modified>
  </item>    
  <item>
  	<title><![CDATA[二叉树遍历非递归算法视频]]></title>	
    <link>http://cgbluesky.blog.163.com/blog/static/241235582008108101513246</link>
    <description><![CDATA[<div><P>这个视频是配套在《数据结构(C#语言描述)》这本书里的一节视频。一共讲解了五个算法：</P>
<P>1、二叉树先序遍历非递归算法</P>
<P>2、二叉树中序遍历非递归算法</P>
<P>3、三种二叉树后序遍历非递归算法</P>
<P style="TEXT-INDENT: 2em">视频下载地址1：<A href="http://bbs.langsin.com/thread-9917-1-1.html">http://bbs.langsin.com/thread-9917-1-1.html</A>
</P><P style="TEXT-INDENT: 2em">视频下载地址2：<A href="http://www.namipan.com/d/%e4%ba%8c%e5%8f%89%e6%a0%91%e9%81%8d%e5%8e%86%e9%9d%9e%e9%80%92%e5%bd%92%e7%ae%97%e6%b3%95.rar/75cce7b0cecef818f1eee8c31ba8cb132cb84fe05e4b7301">http://www.namipan.com/d/%e4%ba%8c%e5%8f%89%e6%a0%91%e9%81%8d%e5%8e%86%e9%9d%9e%e9%80%92%e5%bd%92%e7%ae%97%e6%b3%95.rar/75cce7b0cecef818f1eee8c31ba8cb132cb84fe05e4b7301</A>
</P><P>视频大小：25M；时长：67分钟。其中，后序遍历的非递归算法一直都是难点，所以这里共介绍了三种算法，供大家对比和参考。通过观看视频可以更进一步地了解队列、栈和二叉树。</P>
<P>先导课程可以看这里：</P>
<P><A href="http://cgbluesky.blog.163.com/blog/static/24123558200842311354144/edit/">http://cgbluesky.blog.163.com/blog/static/24123558200842311354144/edit/</A></P>
<P>之前写这篇博客时，有人曾留言说使用递归进行遍历效率太低，所以制作了这个视频让大家了解非递归算法的实现。也希望大家提出意见，看看这样学习数据结构是否会更容易些。</P></div>]]></description>
	    <author><![CDATA[阿巴睇]]></author>
	    <comments>http://cgbluesky.blog.163.com/blog/static/241235582008108101513246</comments>
    <slash:comments>0</slash:comments>
    <guid isPermaLink="true">http://cgbluesky.blog.163.com/blog/static/241235582008108101513246</guid>
    <pubDate>Sat, 8 Nov 2008 22:15:13 +0800</pubDate>
    <dcterms:modified>2008-11-08T23:10:51+08:00</dcterms:modified>
  </item>    
  <item>
  	<title><![CDATA[新书预告---《数据结构--C#语言描述》]]></title>	
    <link>http://cgbluesky.blog.163.com/blog/static/241235582008910115555901</link>
    <description><![CDATA[<div><P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 今天终于把《数据结构--C#语言描述》的全稿发给出版社了，出版社还是北京大学出版社，书还是21世纪高职高专系列。书中配套视频也已完成。忙了很长一段时间，终于可以安逸地坐下来再写写博客了。我喜欢那种休闲的生活，高兴的时候坐下来听听歌，看看书。但回想一下却发现这两年过得很紧张，两年两本书，近100集的视频，业余时间几乎都用在这上面了。不过还好，以后又可以享受休闲生活了。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 这本书在《C#程序设计基础教程与实训》还没出版时我就已经在构思了。在我的构想中，认为程序设计的学习最少应该经过三个基础阶段：基础语法→面向对象→数据结构，为什么要学习数据结构呢？因为它可以让你站在更高的层次去看待程序；它可以让我们领略先辈大师们的思想精髓。只有基础打牢了，后面进行深入地学习才会得心应手。当初一直想上数据结构这门课，但数据结构教材不少，都是用C或C++写的，有少量用Java描述，就是没看见有用C#写的数据结构书籍。C#也出来不少年了，市面上C#的书籍也有上千本了，但国内居然没有一本用C#描述数据结构的书籍，实在有些想不通。总不能为了上数据结构而多开一门C语言的课程吧（时至今日，我还是认为C语言是最好的入门语言，它可以让你排除一切杂念，专心于程序逻辑及思想。但它的缺点是没有可视化编程，无法吸引学生眼球。以前我们学校开过这门课，但最终还是放弃了。）没办法，只有自已动手，丰衣足食。现在这三个阶段的课程已经差不多完成了，面向对象这个阶段没有成书，因为高职对于基础并不太重视，时间也不允许，只能将它以视频的方式供学生自学了。当然，这一块还没做完，以后慢慢再完成吧。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 没写书之前一直怀疑使用C#表述数据结构是否合适，必竟一般情况下它不能直接对内存进行操作。但随着写书的不断深入，这种顾虑完全被打消了，C#是如此优美，简洁，它同样可以完美地展现数据结构的内涵。写书过程中参考了不少数据结构方面的书籍，国内的，国外的，感受是国内这方面的书籍更系统、清晰，表述详细合理，外国的月亮并不一定全比中国的圆。当然代码就没得参考了，幸而C#类库中实现了很多数据结构，而且都写得非常漂亮，就是没有注释，读起来有些困难。<BR>&nbsp;&nbsp;&nbsp; 我这本书跟其他的数据结构书籍还是有那么一点点不同的：<BR>1、尽量减少数学公式<BR>&nbsp;&nbsp;&nbsp; 当然不是完全抛弃，一些简单的数学公式还是有的，这样做的目的是降低学习数据结构的门槛。看看《算法导论》里的数学公式，这会使很多人没开始学习就已经害怕了，它并不适合高职学生。数学可以精确地描述数据结构，但很多东西不用数学公式一样可以表达，相对于数学来说，思想更加重要，数学不好并不意味着做不了程序员。我们的培养目标是技能型人才，研究工作还是留给研究生和博士吧。</P>
<P>2、抛弃伪代码<BR>&nbsp;&nbsp;&nbsp; 伪代码可以简单明了地表述数据结构逻辑，但我更喜欢可运行的代码，它可以让你看到实实在在的结果，也可以通过断点调试、单步运行、修改参数等方式查看数据变化，更进一步地了解数据结构。本书的所有代码均为可运行代码，并且秉承了第一本书的风格，对所有代码进行了详细的注释。</P>
<P>3、配套视频教程<BR>&nbsp;&nbsp;&nbsp; 很多人可能感觉数据结构是一门比较难学的课程，但我在这么多年的教学过程中发现，讲算法比讲代码容易多了，只要使用动画的方式演示数据的移动过程再配以一定的讲解，大部份人都可以很轻松地理解算法的思想。 但仅限于思想，至于如何把思想转化为代码我就无能为力了，这只能靠自己。网上有很多数据结构的动画和视频，但动画不配套讲解，很少视频去演示数据的演变过程，难于让人理解。本书的配套视频主要通过动画讲解各数据结构和算法的运算过程，并不讲解代码，所以对于使用其他语言学习数据结构的人也会有一定的帮助。为了能更好地讲解数据结构，我制作了不少动画和程序，很辛苦，贴几个有代表性的出来。</P>
<P>这个是循环队列：</P>
<P><A href="http://img.blog.163.com/photo/YjQQ903UYcdLng99hON_2Q==/2582532911321151315.jpg" target=_blank><IMG title="新书预告---《数据结构--C语言描述》 - 阿巴睇 - 阿巴睇的博客" alt="新书预告---《数据结构--C语言描述》 - 阿巴睇 - 阿巴睇的博客" src="http://img.blog.163.com/photo/YjQQ903UYcdLng99hON_2Q==/2582532911321151315.jpg"></A></P>
<P>这个是二叉树，设计这个最小面积画树算法花了我不少时间，抓破头皮，几乎绝望的时候突然灵光一闪。。。。。。</P>
<P>本书也介绍了三种画树算法，学习它们对于理解二叉树的本质有很大的帮助。</P>
<P><A href="http://img.blog.163.com/photo/7upYRriTwpbL2eq0e6Azaw==/3731795241230600647.jpg" target=_blank><IMG title="新书预告---《数据结构--C语言描述》 - 阿巴睇 - 阿巴睇的博客" alt="新书预告---《数据结构--C语言描述》 - 阿巴睇 - 阿巴睇的博客" src="http://img.blog.163.com/photo/7upYRriTwpbL2eq0e6Azaw==/3731795241230600647.jpg"></A></P>
<P>这个是迷宫问题最短路径算法的PowerPoint动画</P>
<P><A href="http://img.blog.163.com/photo/jo2i5xYixYuPmEkyblPUnA==/4298122894372593483.jpg" target=_blank><IMG title="新书预告---《数据结构--C语言描述》 - 阿巴睇 - 阿巴睇的博客" alt="新书预告---《数据结构--C语言描述》 - 阿巴睇 - 阿巴睇的博客" src="http://img.blog.163.com/photo/jo2i5xYixYuPmEkyblPUnA==/4298122894372593483.jpg"></A></P>
<P>这是迷宫问题最短路径程序：</P>
<P>&nbsp;<A href="http://img.blog.163.com/photo/BuOVLpMlDFTGYmNRUFaohw==/331577522565875637.jpg" target=_blank><IMG title="新书预告---《数据结构--C语言描述》 - 阿巴睇 - 阿巴睇的博客" alt="新书预告---《数据结构--C语言描述》 - 阿巴睇 - 阿巴睇的博客" src="http://img.blog.163.com/photo/BuOVLpMlDFTGYmNRUFaohw==/331577522565875637.jpg"></A></P>
<P>4、深入C#类库进行介绍</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C#集合类中实现了很多的数据结构，如果对这些集合类没有深刻的理解，是很难写好程序的。本书抽取了C#中一些常用的集合类，并对核心源码进行了分析。</P>
<P>5、配套完整实验指导和实训指导</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp; 这给教师授课省了很多事，实训项目选择了八数码问题，大家还记得第一本书中的拼数字游戏和拼图游戏吧？这个项目就是用电脑求解解题步骤的。使用它还是比较合适的，使用了本书所介绍的很多数据结构。</P>
<P><A href="http://img.blog.163.com/photo/B3Mho3twm6DTMpLC92PkbQ==/5401786278055345051.jpg" target=_blank><IMG title="新书预告---《数据结构--C语言描述》 - 阿巴睇 - 阿巴睇的博客" alt="新书预告---《数据结构--C语言描述》 - 阿巴睇 - 阿巴睇的博客" src="http://img.blog.163.com/photo/B3Mho3twm6DTMpLC92PkbQ==/5401786278055345051.jpg"></A></P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 下面来介绍写书过程中给我留下最深刻印刻的两种数据结构和算法，一个就是KMP算法，一个伟大的算法，个人认为，它是本书中最难的算法。代码非常诡异，区区十数行代码居然包含了如此复杂的逻辑，实在让人汗颜，在此向前辈大师深深地致敬。另一个就是C#中的Dictionary&lt;TKey,TValue&gt;类，第一次读这段代码时让我有拍案叫绝的感觉，实在是太漂亮了，我被她的美所深深折服。感叹自己怎么就想不出这么巧妙的实现呢！当然我也没忘记用程序来展现她的美：</P>
<P><A href="http://img.blog.163.com/photo/dIg2Mn2yy7XF4_5qTrXrYA==/2857252488590800712.jpg" target=_blank><IMG title="新书预告---《数据结构--C语言描述》 - 阿巴睇 - 阿巴睇的博客" alt="新书预告---《数据结构--C语言描述》 - 阿巴睇 - 阿巴睇的博客" src="http://img.blog.163.com/photo/dIg2Mn2yy7XF4_5qTrXrYA==/2857252488590800712.jpg"></A></P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 由于是高职高专教材，所以只能介绍那些最基本的数据结构，本书做为数据结构的入门教材还是非常合适的。最遗憾的是没有讲解SortedDictionary，它是红黑树的实现，实在是太过复杂，不适合高职使用。这些高级的数据结构将来我会以博客的方式写出来。本书的出版时间大约是明年初，敬请关注。</P>
<P>AVL和红黑树请查看以下网址：</P>
<P>AVL树：</P>
<P><A href="http://www.cnblogs.com/abatei/archive/2008/11/17/1335031.html"><FONT color=#91680d>http://www.cnblogs.com/abatei/archive/2008/11/17/1335031.html</FONT></A></P>
<P>红黑树：</P>
<P><A href="http://www.cnblogs.com/abatei/archive/2008/12/17/1356565.html"><FONT color=#91680d>http://www.cnblogs.com/abatei/archive/2008/12/17/1356565.html</FONT></A></P>
<P>视频公布了一集，请到以下地址下载：</P>
<P><SPAN lang=EN-US style="mso-bidi-font-family: 宋体"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman"><FONT face=Arial><A href="http://www.fileupyours.com/files/219335/5-2.swf"></A><A href="http://www.fileupyours.com/files/219335/5-2.swf"><FONT color=#91680d>http://www.fileupyours.com/files/219335/5-2.swf</FONT></A></FONT></FONT></SPAN></SPAN></P></div>]]></description>
	    <author><![CDATA[阿巴睇]]></author>
	    <comments>http://cgbluesky.blog.163.com/blog/static/241235582008910115555901</comments>
    <slash:comments>29</slash:comments>
    <guid isPermaLink="true">http://cgbluesky.blog.163.com/blog/static/241235582008910115555901</guid>
    <pubDate>Sat, 11 Oct 2008 00:30:58 +0800</pubDate>
    <dcterms:modified>2009-03-17T23:44:14+08:00</dcterms:modified>
  </item>    
  <item>
  	<title><![CDATA[Today]]></title>	
    <link>http://cgbluesky.blog.163.com/blog/static/241235582008811105446755</link>
    <description><![CDATA[<div><P>第一次听到《Today》这首歌是很多年前的事了，那是欧瑞强的一张民歌专辑，当时被这优美的旋律深深吸引。近日偶然听到藤田惠美重新演绎的这首歌，还是那么动人。我决定要把这首歌背下来，在网上找到了歌词，看了一下，感觉没有国外的文化背景很难理解这首歌含义，不过这又有什么关系呢！歌词虽然是外文，但很有诗性。</P>
<P>Today while the blossoms still cling to the vine (今天，当那些花儿仍攀附着藤蔓)<BR>I'll taste your straw berries （我将品尝你的草莓）<BR>I'll drink your sweet wine&nbsp; （我将痛饮你的二锅头）<BR><BR>A million tomorrows shall all pass away<BR>Ere I forget all the joy that is mine<BR>today</P>
<P>（就在我忘却今天的欢乐之前，百万个明天都会逝去）<BR><BR>I'll be a dandy and I'll be a rover （我会成为花花公子，我会成为一个流浪汉）<BR>You'll know who I am by the song that I sing （听到我的歌声，就会知道我是谁）<BR>I'll feast at your table （我要与你共饮）<BR>I'll sleep in your clover （我要安逸地睡着）<BR><BR>Who cares what the morrow shall bring? （不要在意明天会如何）<BR><BR>Today while the blossoms still cling to the vine&nbsp; <BR>I'll taste your straw berries <BR>I'll drink your sweet wine </P>
<P><BR>I can't be contented with yesterday's glory （我不能满足于昨日的辉煌）<BR>I can't live on promises winter to spring （冬去春来，我不能把诺言守望）<BR><BR>Today is my moment and now is my story （今天是属于我的时刻，现在是我的故事）<BR>I'll laugh and I'll cry and I'll sing （我要放声大笑，我要哭泣，我要歌唱）<BR><BR>Today while the blossoms still cling to the vine<BR>I'll taste your straw berries<BR>I'll drink your sweet wine<BR>A million tomorrows shall all pass away<BR>Ere I forget all the joy that is mine today<BR></P></div>]]></description>
	    <author><![CDATA[阿巴睇]]></author>
	    <comments>http://cgbluesky.blog.163.com/blog/static/241235582008811105446755</comments>
    <slash:comments>0</slash:comments>
    <guid isPermaLink="true">http://cgbluesky.blog.163.com/blog/static/241235582008811105446755</guid>
    <pubDate>Thu, 11 Sep 2008 22:54:46 +0800</pubDate>
    <dcterms:modified>2008-09-11T22:57:56+08:00</dcterms:modified>
  </item>    
  <item>
  	<title><![CDATA[C#与数据结构--图的遍历]]></title>	
    <link>http://cgbluesky.blog.163.com/blog/static/241235582008561245867</link>
    <description><![CDATA[<div><H2 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="mso-no-proof: yes">8.2 </SPAN><SPAN style="FONT-FAMILY: 黑体; mso-no-proof: yes; mso-ascii-font-family: Arial">图的存储结构</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></H2>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图的存储结构除了要存储图中各个顶点的本身的信息外，同时还要存储顶点与顶点之间的所有关系（边的信息），因此，图的结构比较复杂，很难以数据元素在存储区中的物理位置来表示元素之间的关系，但也正是由于其任意的特性，故物理表示方法很多。常用的图的存储结构有邻接矩阵、邻接表、十字链表和邻接多重表。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<H3 style="MARGIN: 13pt 0cm"><FONT size=5><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8.2.1<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">邻接矩阵表示法</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></FONT></H3>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对于一个具有</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">n</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个顶点的图，可以使用</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">n*n</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的矩阵（二维数组）来表示它们间的邻接关系。图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8.10</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8.11</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中，矩阵</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">A(i</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">j)=1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示图中存在一条边</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">(V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">i</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">j</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes">)</SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，而</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">A(i</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">j)=0</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示图中不存在边</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">(V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">i</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">j</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes">)</SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。实际编程时，当图为不带权图时，可以在二维数组中存放</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">bool</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">值，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">A(i</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">j)=true</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示存在边</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">(V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">i</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">j</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes">)</SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">A(i</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">j)=false</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示不存在边</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">(V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">i</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">j</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes">)</SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">；当图带权值时，则可以直接在二维数组中存放权值，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">A(i</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">j)=null</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示不存在边</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">(V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">i</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">j</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes">)</SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"></SPAN>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US style="mso-no-proof: yes"><A href="http://img.blog.163.com/photo/nmPAJHgKCpxWkGKR16SnOw==/883831426872067945.jpg" target=_blank><IMG src="http://img.blog.163.com/photo/nmPAJHgKCpxWkGKR16SnOw==/883831426872067945.jpg"></A></SPAN></P><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face=宋体>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8.10</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所示的是无向图的邻接矩阵表示法，可以观察到，矩阵延对角线对称，即</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">A(i</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">j)= A(j</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">i)</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。无向图邻接矩阵的第</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">i</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">行或第</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">i</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">列非零元素的个数其实就是第</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">i</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个顶点的度。这表示无向图邻接矩阵存在一定的数据冗余。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8.11</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所示的是有向图邻接矩阵表示法，矩阵并不延对角线对称，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">A(i</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">j)=1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">表示顶点</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">i</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">邻接到顶点</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">j</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">；</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">A(j</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">i)=1</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">则表示顶点</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">i</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">邻接自顶点</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">j</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。两者并不象无向图邻接矩阵那样表示相同的意思。有向图邻接矩阵的第</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">i</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">行非零元素的个数其实就是第</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">i</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个顶点的出度，而第</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">i</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">列非零元素的个数是第</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">i</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个顶点的入度，即第</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">i</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个顶点的度是第</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">i</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">行和第</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">i</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">列非零元素个数之和。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">由于存在</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">n</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个顶点的图需要</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">n</SPAN><SUP><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">2</SPAN></SUP></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-bidi-font-size: 10.5pt; mso-hansi-font-family: 'Times New Roman'">个数组元素进行存储，</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">当图为稀疏图时，使用邻接矩阵存储方法将出现大量零元素，照成极大地空间浪费，这时应该使用邻接表表示法存储图中的数据。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<H3 style="MARGIN: 13pt 0cm"><FONT size=5><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8.2.2 </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">邻接表表示法</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></FONT></H3>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图的邻接矩阵存储方法跟树的孩子链表示法相类似，是一种顺序分配和链式分配相结合的存储结构。邻接表由表头结点和表结点两部分组成，其中图中每个顶点均对应一个存储在数组中的表头结点。如这个表头结点所对应的顶点存在相邻顶点，则把相邻顶点依次存放于表头结点所指向的单向链表中。如图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8.12</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所示，表结点存放的是邻接顶点在数组中的索引。对于无向图来说，使用邻接表进行存储也会出现数据冗余，表头结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">A</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所指链表中存在一个指向</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">C</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的表结点的同时，表头结点</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">C</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所指链表也会存在一个指向</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">A</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的表结点。</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><A href="http://img.blog.163.com/photo/rZtBzPH2oao6oc48VSNQdQ==/566327653142318394.jpg" target=_blank><IMG src="http://img.blog.163.com/photo/rZtBzPH2oao6oc48VSNQdQ==/566327653142318394.jpg"></A></SPAN></P><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有向图的邻接表有出边表和入边表（又称逆邻接表）之分。出边表的表结点存放的是从表头结点出发的有向边所指的尾顶点；入边表的表结点存放的则是指向表头结点的某个头顶点。如图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8.13</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所示，图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">(b)</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">(c)</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分别为有向图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">(a)</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的出边表和入边表。</SPAN></P><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"></SPAN>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US style="mso-no-proof: yes"><A href="http://img.blog.163.com/photo/WciqOLVWd3SNBlWkG8omlA==/3730387866346859417.jpg" target=_blank><IMG src="http://img.blog.163.com/photo/WciqOLVWd3SNBlWkG8omlA==/3730387866346859417.jpg"></A></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">以上所讨论的邻接表所表示的都是不带权的图，如果要表示带权图，可以在表结点中增加一个存放权的字段，其效果如图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8.14</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所示。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US style="mso-no-proof: yes"><A href="http://img.blog.163.com/photo/4IXTAwGWz3aS3QgfZu6zrw==/566327653142318402.jpg" target=_blank><IMG src="http://img.blog.163.com/photo/4IXTAwGWz3aS3QgfZu6zrw==/566327653142318402.jpg"></A></SPAN></P><SPAN lang=EN-US style="mso-no-proof: yes">
<P style="MARGIN: 0cm 22.9pt 0pt 27pt; mso-para-margin-top: 0cm; mso-para-margin-right: 2.18gd; mso-para-margin-bottom: .0001pt; mso-para-margin-left: 2.57gd"><SPAN style="FONT-FAMILY: 楷体_GB2312">【注意】：观察图<SPAN lang=EN-US>8.14</SPAN>可以发现，当删除存储表头结点的数组中的某一元素，有可能使部分表头结点索引号的改变，从而导致大面积修改表结点的情况发生。可以在表结点中直接存放指向表头结点的指针以解决这个问题（在链表中存放类实例即是存放指针，但必须要保证表头结点是类而不是结构体）。在实际创建邻接表时，甚至可以使用链表代替数组存放表头结点或使用顺序表存代替链表存放表结点。对所学的数据结构知识应当根据实际情况及所使用语言的特点灵活应用，切不可生搬硬套。<SPAN lang=EN-US></SPAN></SPAN></P>
<P style="MARGIN: 0cm 22.9pt 0pt 0cm; mso-para-margin-right: 2.18gd"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">【例</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">8-1<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>AdjacencyList.cs</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">】图的邻接表存储结构</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">1<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>&65279;using System;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">2<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>using System.Collections.Generic;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">3<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>public class AdjacencyList&lt;T&gt;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">4<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">5<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>List&lt;Vertex&lt;T&gt;&gt; items; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">图的顶点集合</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">6<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>public AdjacencyList() : this(10) { } //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">构造方法</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">7<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>public AdjacencyList(int capacity) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">指定容量的构造方法</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">8<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">9<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>items = new List&lt;Vertex&lt;T&gt;&gt;(capacity);</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">10<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">11<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>public void AddVertex(T item) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">添加一个顶点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">12<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">不允许插入重复值</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">13<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (Contains(item))</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">14<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">15<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>throw new ArgumentException("</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">插入了重复顶点！</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">16<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">17<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>items.Add(new Vertex&lt;T&gt;(item));</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">18<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">19<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>public void AddEdge(T from, T to) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">添加无向边</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">20<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">21<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Vertex&lt;T&gt; fromVer = Find(from); //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">找到起始顶点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">22<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (fromVer == null)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">23<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">24<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>throw new ArgumentException("</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">头顶点并不存在！</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">25<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">26<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Vertex&lt;T&gt; toVer = Find(to); //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">找到结束顶点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">27<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;</SPAN>if (toVer == null)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">28<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">29<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>throw new ArgumentException("</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">尾顶点并不存在！</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">30<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">31<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">无向边的两个顶点都需记录边信息</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">32<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>AddDirectedEdge(fromVer, toVer);</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">33<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>AddDirectedEdge(toVer, fromVer);</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">34<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">35<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>public bool Contains(T item) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">查找图中是否包含某项</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">36<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">37<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>foreach (Vertex&lt;T&gt; v in items)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">38<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">39<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (v.data.Equals(item))</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">40<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">41<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return true;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">42<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">43<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">44<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return false;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">45<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">46<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>private Vertex&lt;T&gt; Find(T item) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">查找指定项并返回</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">47<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">48<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>foreach (Vertex&lt;T&gt; v in items)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">49<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">50<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (v.data.Equals(item))</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">51<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">52<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return v;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">53<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">54<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">55<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return null;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">56<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">57<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">添加有向边</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">58<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>private void AddDirectedEdge(Vertex&lt;T&gt; fromVer, Vertex&lt;T&gt; toVer)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">59<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">60<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (fromVer.firstEdge == null) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">无邻接点时</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">61<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">62<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>fromVer.firstEdge = new Node(toVer);</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">63<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">64<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>else</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">65<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">66<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Node tmp, node = fromVer.firstEdge;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">67<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>do</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">68<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">检查是否添加了重复边</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">69<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (node.adjvex.data.Equals(toVer.data))</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">70<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">71<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>throw new ArgumentException("</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">添加了重复的边！</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">72<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">73<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>tmp = node;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">74<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>node = node.next;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">75<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>} while (node != null);</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">76<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>tmp.next = new Node(toVer); //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">添加到链表未尾</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">77<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">78<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">79<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>public override string ToString() //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">仅用于测试</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">80<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">打印每个节点和它的邻接点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">81<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>string s = string.Empty;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">82<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>foreach (Vertex&lt;T&gt; v in items)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">83<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">84<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>s += v.data.ToString() + ":";</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">85<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (v.firstEdge != null)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">86<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">87<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>Node tmp = v.firstEdge;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">88<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>while (tmp != null)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">89<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">90<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>s += tmp.adjvex.data.ToString();</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">91<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>tmp = tmp.next;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">92<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">93<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">94<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>s += "\r\n";</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">95<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">96<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return s;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">97<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">98<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">嵌套类，表示链表中的表结点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">99<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>public class Node</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">100<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">101<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>public Vertex&lt;T&gt; adjvex; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">邻接点域</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">102<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>public Node next; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">下一个邻接点指针域</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">103<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>public Node(Vertex&lt;T&gt; value)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">104<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">105<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>adjvex = value;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">106<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">107<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">108<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">嵌套类，表示存放于数组中的表头结点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">109<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>public class Vertex&lt;TValue&gt;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">110<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">111<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>public TValue data; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">数据</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">112<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>public Node firstEdge; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">邻接点链表头指针</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">113<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>public Boolean visited; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">访问标志</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">,</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">遍历时使用</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">114<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>public Vertex(TValue value) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">构造方法</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">115<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">116<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>data = value;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">117<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">118<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">119 }</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AdjacencyList&lt;T&gt;</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类使用泛型实现了图的邻接表存储结构。它包含两个内部类，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">Vertex&lt;Tvalue&gt;</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类（</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">10</FONT></SPAN><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-no-proof: yes">9</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes">～<SPAN lang=EN-US>118</SPAN>行代码</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）用于表示一个表头结点，</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">Node</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类（</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">9</FONT></SPAN><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-no-proof: yes">9</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes">～<SPAN lang=EN-US>107</SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）则用于表示表结点，其中存放着邻接点信息，用来表示表头结点的某条边。多个</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">Node</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">next</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指针相连形成一个单链表，表头指针为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">Vertex</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类的</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">firstEdge</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">成员，表头结点所代表的顶点的所有边的信息均包含在链表内，其结构如图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8.12</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所示。所不同之处在于：</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-no-proof: yes; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">Vertex</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类中包含了一个</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">visited</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">成员，它的作用是在图遍历时标识当前节点是否被访问过，这一点在稍后会讲到。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-no-proof: yes; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">邻接点指针域</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">adjvex</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">直接指向某个表头结点，而不是表头结点在数组中的索引。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AdjacencyList&lt;T&gt;</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类中使用了一个泛型</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">List</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">代替数组来保存表头结点信息（第</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">5</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">行代码），从而不再考虑数组存储空间不够的情况发生，简化了操作。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">由于一条无向边的信息需要在边的两个顶点分别存储信息，即添加两个有向边，所以</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">5</FONT></SPAN><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-no-proof: yes">8</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes">～<SPAN lang=EN-US>78</SPAN>行代码的私有方法<SPAN lang=EN-US>AddDirectedEdge()</SPAN>方法用于添加一个有向边。新的邻接点信息即可以添加到链表的头部也可以添加到尾部，添加到链表头部可以简化操作，但考虑到要检查是否添加了重复边，需要遍历整个链表，所以最终把邻接点信息添加到链表尾部。<SPAN lang=EN-US></SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">【例</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">8-1<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Demo8-1.cs</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">】图的邻接表存储结构测试</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">1<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&65279;using System;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">2<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>class Demo8_1</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">3<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">4<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>static void Main(string[] args)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">5<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">6<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>AdjacencyList&lt;char&gt; a = new AdjacencyList&lt;char&gt;();</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">7<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">添加顶点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">8<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddVertex('A');</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">9<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddVertex('B');</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">10<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddVertex('C');</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">11<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddVertex('D');</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">12<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">添加边</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">13<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddEdge('A', 'B');</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">14<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddEdge('A', 'C');</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">15<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddEdge('A', 'D');</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">16<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddEdge('B', 'D');</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">17<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Console.WriteLine(a.ToString());</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">18<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">19 }</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">运行结果：</SPAN></P><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">A</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BCD</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">B</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AD</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">C</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">A</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">D</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AB</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本例存储的表如图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8.12</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所示，结果中，冒号前面的是表头结点，冒号后面的是链表中的表结点。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<H2 style="MARGIN: 13pt 0cm"><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face=Arial>8.3 </FONT></SPAN><SPAN style="FONT-FAMILY: 黑体; mso-no-proof: yes; mso-ascii-font-family: Arial">图的遍历</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></H2>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和树的遍历类似，在此，我们希望从图中某一顶点出发访遍图中其余顶点，且使每一个顶点仅被访问一次，这一过程就叫做图的遍历</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">(TraversingGraph)</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。如果只访问图的顶点而不关注边的信息，那么图的遍历十分简单，使用一个</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">foreach</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语句遍历存放顶点信息的数组即可。但如果为了实现特定算法，就需要根据边的信息按照一定顺序进行遍历。图的遍历算法是求解图的连通性问题、拓扑排序和求关键路径等算法的基础。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图的遍历要比树的遍历复杂得多，由于图的任一顶点都可能和其余顶点相邻接，故在访问了某顶点之后，可能顺着某条边又访问到了已访问过的顶点，因此，在图的遍历过程中，必须记下每个访问过的顶点，以免同一个顶点被访问多次。为此给顶点附设访问标志</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">visited</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，其初值为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">false</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，一旦某个顶点被访问，则其</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">visited</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">标志置为</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">true</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图的遍历方法有两种：一种是深度优先搜索遍历（</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">Depth-First Search </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">简称</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">DFS</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）；另一种是广度优先搜索遍历（</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">Breadth_First Search </FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">简称</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">BFS</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<H3 style="MARGIN: 13pt 0cm"><FONT size=5><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8.3.1<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">深度优先搜索遍历</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></FONT></H3>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图的深度优先搜索遍历类似于二叉树的深度优先搜索遍历。其基本思想如下：假定以图中某个顶点</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">i</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为出发点，首先访问出发点，然后选择一个</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">i</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的未访问过的邻接点</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">j</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，以</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">j</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为新的出发点继续进行深度优先搜索，直至图中所有顶点都被访问过。显然，这是一个递归的搜索过程。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">现以图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8.15</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为例说明深度优先搜索过程。假定</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">1</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是出发点，首先访问</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">1</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。因</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">1</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有两个邻接点</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">2</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">3</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">均末被访问过，可以选择</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">2</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作为新的出发点，访问</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">2</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">之后，再找</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">2</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的末访问过的邻接点。同</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">2</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">邻接的有</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">1</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">4</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">5</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，其中</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">1</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">已被访问过，而</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">4</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">5</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">尚未被访问过，可以选择</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">4</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">作为新的出发点。重复上述搜索过程，继续依次访问</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">8</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">5</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes"> </SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。访问</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">5</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">之后，由于与</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">5</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">相邻的顶点均已被访问过，搜索退回到</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">8</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，访问</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">8</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的另一个邻接点</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">6</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。接下来依次访问</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">3</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">7</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，最后得到的的顶点的访问序列为：</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">1</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes"> </SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">→</SPAN><FONT face="Times New Roman"><SPAN style="mso-no-proof: yes"> <SPAN lang=EN-US>V</SPAN></SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">2</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes"> </SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">→</SPAN><FONT face="Times New Roman"><SPAN style="mso-no-proof: yes"> <SPAN lang=EN-US>V</SPAN></SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">4</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes"> </SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">→</SPAN><FONT face="Times New Roman"><SPAN style="mso-no-proof: yes"> <SPAN lang=EN-US>V</SPAN></SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">8</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes"> </SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">→</SPAN><FONT face="Times New Roman"><SPAN style="mso-no-proof: yes"> <SPAN lang=EN-US>V</SPAN></SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">5</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes"> </SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">→</SPAN><FONT face="Times New Roman"><SPAN style="mso-no-proof: yes"> <SPAN lang=EN-US>V</SPAN></SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">6</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes"> </SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">→</SPAN><FONT face="Times New Roman"><SPAN style="mso-no-proof: yes"> <SPAN lang=EN-US>V</SPAN></SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">3</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes"> </SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">→</SPAN><FONT face="Times New Roman"><SPAN style="mso-no-proof: yes"> <SPAN lang=EN-US>V</SPAN></SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">7</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><A href="http://img.blog.163.com/photo/Mk0vNPsvT5w6Jg5EmyNDEA==/566327653142318403.jpg" target=_blank><IMG src="http://img.blog.163.com/photo/Mk0vNPsvT5w6Jg5EmyNDEA==/566327653142318403.jpg"></A></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下面根据上一节创建的邻接表存储结构添加深度优先搜索遍历代码。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 22.9pt 0pt 0cm; mso-para-margin-right: 2.18gd"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">【例</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">8-2<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>DFSTraverse.cs</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">】深度优先搜索遍历</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">打开</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">【例</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">8-1<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>AdjacencyList.cs</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">】，<SPAN style="mso-no-proof: yes">在</SPAN></SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">AdjacencyList&lt;T&gt;</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类中添加以下代码后，将文件另存为</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">DFSTraverse.cs</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">35<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>public void DFSTraverse() //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">深度优先遍历</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">36<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">37<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>InitVisited(); //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">将</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">visited</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">标志全部置为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">false</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">38<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DFS(items[0]); //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">从第一个顶点开始遍历</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">39<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">40<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>private void DFS(Vertex&lt;T&gt; v) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">使用递归进行深度优先遍历</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">41<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">42<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>v.visited = true; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">将访问标志设为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">true</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">43<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Console.Write(v.data + " "); //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">访问</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">44<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Node node = v.firstEdge;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">45<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>while (node != null) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">访问此顶点的所有邻接点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">46<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">如果邻接点未被访问，则递归访问它的边</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">47<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (!node.adjvex.visited)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">48<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">49<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DFS(node.adjvex); //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">递归</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">50<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">51<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>node = node.next; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">访问下一个邻接点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">52<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">53<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">&nbsp;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">98<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>private void InitVisited() //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">初始化</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">visited</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">标志</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">99<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">100<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>foreach (Vertex&lt;T&gt; v in items)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">101<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">102<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>v.visited = false; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">全部置为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">false</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">103<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">104<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 22.9pt 0pt 0cm; mso-para-margin-right: 2.18gd"><SPAN lang=EN-US><FONT face="Times New Roman">&nbsp;</FONT></SPAN></P>
<P style="MARGIN: 0cm 22.9pt 0pt 0cm; mso-para-margin-right: 2.18gd"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">【例</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">8-2<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Demo8-2.cs</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">】深度优先搜索遍历测试</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">1<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&65279;using System;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">2<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>class Demo8_2</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">3<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">4<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>static void Main(string[] args)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">5<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">6<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>AdjacencyList&lt;string&gt; a = new AdjacencyList&lt;string&gt;();</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">7<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddVertex("V1");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">8<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddVertex("V2");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">9<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddVertex("V3");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">10<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddVertex("V4");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">11<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddVertex("V5");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">12<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddVertex("V6");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">13<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddVertex("V7");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">14<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddVertex("V8");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">15<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddEdge("V1", "V2");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">16<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddEdge("V1", "V3");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">17<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>a.AddEdge("V2", "V4");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">18<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddEdge("V2", "V5");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">19<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddEdge("V3", "V6");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">20<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddEdge("V3", "V7");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">21<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddEdge("V4", "V8");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">22<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddEdge("V5", "V8");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">23<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddEdge("V6", "V8");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">24<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.AddEdge("V7", "V8");</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">25<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a.DFSTraverse();</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">26<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">27 }</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">运行结果：</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">V1 V2 V4 V8 V5 V6 V3 V7</FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">本例参照图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8-15</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">进行设计，运行过程请参照对图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8-15</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所作的分析。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<H3 style="MARGIN: 13pt 0cm"><FONT size=5><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8.3.2<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">广度优先搜索遍历</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></FONT></H3>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图的广度优先搜索遍历算法是一个分层遍历的过程，和二叉树的广度优先搜索遍历类同。它从图的某一顶点</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">i</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">出发，访问此顶点后，依次访问</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">i</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的各个未曾访问过的邻接点，然后分别从这些邻接点出发，直至图中所有已有已被访问的顶点的邻接点都被访问到。对于图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8.15</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所示的无向连通图，若顶点</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">i</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为初始访问的顶点，则广度优先搜索遍历顶点访问顺序是：</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes">V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">1</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes"> </SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">→</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes"> V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">2</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes"> </SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">→</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes"> V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">3</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes"> </SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">→</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes"> V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">4</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes"> </SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">→</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes"> V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">5</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes"> </SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">→</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes"> V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">6</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes"> </SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">→</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes"> V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">7</SPAN></SUB><SPAN lang=EN-US style="mso-no-proof: yes"> </SPAN></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">→</SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="mso-no-proof: yes"> V</SPAN><SUB><SPAN lang=EN-US style="mso-no-proof: yes; mso-bidi-font-size: 10.5pt">8</SPAN></SUB></FONT><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。遍历过程如图</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">8.16</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的所示。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman"><A href="http://img.blog.163.com/photo/kIs712m_PyYUsDkD8VTKeQ==/566327653142318405.jpg" target=_blank><IMG src="http://img.blog.163.com/photo/kIs712m_PyYUsDkD8VTKeQ==/566327653142318405.jpg"></A></FONT></SPAN></P><SPAN lang=EN-US style="mso-no-proof: yes"><FONT face="Times New Roman">
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和二叉树的广度优先搜索遍历类似，图的广度优先搜索遍历也需要借助队列来完成，例</SPAN><SPAN lang=EN-US style="mso-no-proof: yes">8.3</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">演示了这个过程。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 22.9pt 0pt 0cm; mso-para-margin-right: 2.18gd"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">【例</SPAN><SPAN lang=EN-US>8-3<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>BFSTraverse.cs</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">】广度优先搜索遍历</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">打开</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">【例</SPAN><SPAN lang=EN-US>8-2<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>DFSTraverse.cs</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">】，<SPAN style="mso-no-proof: yes">在</SPAN></SPAN><SPAN lang=EN-US style="mso-no-proof: yes">AdjacencyList&lt;T&gt;</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-no-proof: yes; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类中添加以下代码后，将文件另存为</SPAN><SPAN lang=EN-US>BFSTraverse.cs</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN><SPAN lang=EN-US style="mso-no-proof: yes"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">54<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>public void BFSTraverse() //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">广度优先遍历</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">55<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">56<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>InitVisited(); //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">将</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">visited</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">标志全部置为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">false</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">57<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>BFS(items[0]); //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">从第一个顶点开始遍历</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">58<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">59<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>private void BFS(Vertex&lt;T&gt; v) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">使用队列进行广度优先遍历</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">60<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">创建一个队列</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">61<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>Queue&lt;Vertex&lt;T&gt;&gt; queue = new Queue&lt;Vertex&lt;T&gt;&gt;();</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">62<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Console.Write(v.data + " "); //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">访问</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">63<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>v.visited = true; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">设置访问标志</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">64<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>queue.Enqueue(v); //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">进队</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">65<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>while (queue.Count &gt; 0) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">只要队不为空就循环</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">66<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">67<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Vertex&lt;T&gt; w = queue.Dequeue();</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">68<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Node node = w.firstEdge;</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">69<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>while (node != null) //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">访问此顶点的所有邻接点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">70<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">如果邻接点未被访问，则递归访问它的边</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">71<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>if (!node.adjvex.visited)</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">72<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">73<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Console.Write(node.adjvex.data + " "); //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">访问</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">74<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>node.adjvex.visited = true; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">设置访问标志</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">75<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>queue.Enqueue(node.adjvex); //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">进队</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">76<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">77<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>node = node.next; //</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 新宋体; mso-no-proof: yes; mso-ascii-font-family: 'Courier New'; mso-font-kerning: 0pt; mso-bidi-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'">访问下一个邻接点</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt"></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">78<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}</SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 12pt; TEXT-ALIGN: left; mso-line-height-rule: exactly; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: #993366; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 新宋体; mso-font-kerning: 0pt">79<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <