锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品久久新婚兰兰,国产精品美女久久福利网站,久久久无码一区二区三区http://www.shnenglu.com/xingkongyun/category/7344.html鏄熺┖闄ㄧ殑紼嬪簭灝忕珯zh-cnFri, 19 Sep 2008 22:02:14 GMTFri, 19 Sep 2008 22:02:14 GMT60寰幆闃熷垪瀹炵幇http://www.shnenglu.com/xingkongyun/articles/62301.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Fri, 19 Sep 2008 11:52:00 GMThttp://www.shnenglu.com/xingkongyun/articles/62301.htmlhttp://www.shnenglu.com/xingkongyun/comments/62301.htmlhttp://www.shnenglu.com/xingkongyun/articles/62301.html#Feedback0http://www.shnenglu.com/xingkongyun/comments/commentRss/62301.htmlhttp://www.shnenglu.com/xingkongyun/services/trackbacks/62301.html 1//鏁版嵁緇撴瀯闃熷垪綆鍗曞疄鐜幫紙寰幆闃熷垪錛?/span>
 2#ifndef QUEUE_H
 3#define QUEUE_H
 4
 5template<class T>
 6class Queue
 7{
 8public:
 9    Queue(int maxsize=50); 
10    virtual ~Queue();
11    bool IsFull(){return (rear+1)%MaxSize==front?true:false;}//婊★紵
12    bool IsEmpty(){return front==rear?true:false;};//絀猴紵
13    Queue<T>& Push(const T& val);//鍚戦槦灝炬彃鍏ュ厓绱?/span>
14    Queue<T>& Pop(T& e);//浠庡爢澶村垹闄ゅ厓绱?/span>
15    int Size(){return _Size;};//榪斿洖闃熷垪鍏冪礌涓暟
16    T& Front();//榪斿洖瀵瑰ご鍏冪礌
17    T& Back();//榪斿洖闃熷熬鍏冪礌
18    
19private:
20    T *data;
21    int front,rear;
22    int MaxSize;
23    int _Size;
24}
;
25//------------------------------------------------
26template<class T>
27Queue<T>::Queue(int maxsize)
28{
29    data=new T[maxsize+1];
30    MaxSize=maxsize+1;
31    front=rear=_Size=0;
32    
33}

34//------------------------------------------------
35template<class T>
36Queue<T>::~Queue()
37{
38    delete[] data;
39}

40//------------------------------------------------
41template<class T>
42Queue<T>& Queue<T>::Push(const T& val)
43{
44    if(IsFull()) throw exception("闃熷垪宸叉弧");
45    rear=(rear+1)%MaxSize;
46    data[rear]=val;
47    _Size++;
48    return *this;
49}

50//------------------------------------------------
51template<class T>
52Queue<T>& Queue<T>::Pop(T& e)
53{
54    if(IsEmpty()) throw exception("闃熷垪宸茬┖");
55    front=(front+1)%MaxSize;
56    e=data[front];
57    _Size--;
58    return *this;
59}

60//------------------------------------------------
61template<class T>
62T& Queue<T>::Front()
63{
64    if(IsEmpty()) throw exception("闃熷垪宸茬┖");
65    return data[(front+1)%MaxSize];
66    
67}

68//------------------------------------------------
69template<class T>
70T& Queue<T>::Back()
71{
72    if(IsEmpty()) throw exception("闃熷垪宸茬┖");
73    return data[rear];
74    
75}

76#endif

]]>
鏁版嵁緇撴瀯鏍堢畝鍗曞疄鐜幫紙鍩轟簬閾捐〃錛?/title><link>http://www.shnenglu.com/xingkongyun/articles/62298.html</link><dc:creator>鏉ㄥ漿褰?/dc:creator><author>鏉ㄥ漿褰?/author><pubDate>Fri, 19 Sep 2008 11:09:00 GMT</pubDate><guid>http://www.shnenglu.com/xingkongyun/articles/62298.html</guid><wfw:comment>http://www.shnenglu.com/xingkongyun/comments/62298.html</wfw:comment><comments>http://www.shnenglu.com/xingkongyun/articles/62298.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/xingkongyun/comments/commentRss/62298.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/xingkongyun/services/trackbacks/62298.html</trackback:ping><description><![CDATA[<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080"> 1</span><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鏁版嵁緇撴瀯鏍堝疄鐜幫紙鍩轟簬閾捐〃錛?/span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080"> 2</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">#ifndef STACKLIST_H<br></span><span style="COLOR: #008080"> 3</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> STACKLIST_H</span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 4</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鑺傜偣緇撴瀯</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080"> 5</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 6</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> Node<br></span><span style="COLOR: #008080"> 7</span><span style="COLOR: #000000"><img id=Codehighlighter1_92_173_Open_Image onclick="this.style.display='none'; Codehighlighter1_92_173_Open_Text.style.display='none'; Codehighlighter1_92_173_Closed_Image.style.display='inline'; Codehighlighter1_92_173_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_92_173_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_92_173_Closed_Text.style.display='none'; Codehighlighter1_92_173_Open_Image.style.display='inline'; Codehighlighter1_92_173_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_92_173_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_92_173_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 8</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br></span><span style="COLOR: #008080"> 9</span><span style="COLOR: #000000"><img id=Codehighlighter1_124_144_Open_Image onclick="this.style.display='none'; Codehighlighter1_124_144_Open_Text.style.display='none'; Codehighlighter1_124_144_Closed_Image.style.display='inline'; Codehighlighter1_124_144_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_124_144_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_124_144_Closed_Text.style.display='none'; Codehighlighter1_124_144_Open_Image.style.display='inline'; Codehighlighter1_124_144_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>        Node(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> T </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000"> val)</span><span id=Codehighlighter1_124_144_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_124_144_Open_Text><span style="COLOR: #000000">{data</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">val;next</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">NULL;}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">10</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        T data;<br></span><span style="COLOR: #008080">11</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        Node</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">next;<br></span><span style="COLOR: #008080">12</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">13</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080">14</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鏍堝疄鐜?/span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">15</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">16</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> Stack<br></span><span style="COLOR: #008080">17</span><span style="COLOR: #000000"><img id=Codehighlighter1_213_440_Open_Image onclick="this.style.display='none'; Codehighlighter1_213_440_Open_Text.style.display='none'; Codehighlighter1_213_440_Closed_Image.style.display='inline'; Codehighlighter1_213_440_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_213_440_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_213_440_Closed_Text.style.display='none'; Codehighlighter1_213_440_Open_Image.style.display='inline'; Codehighlighter1_213_440_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_213_440_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_213_440_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">18</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br></span><span style="COLOR: #008080">19</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    Stack();<br></span><span style="COLOR: #008080">20</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">virtual</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">~</span><span style="COLOR: #000000">Stack();<br></span><span style="COLOR: #008080">21</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000"> IsEmpty();<br></span><span style="COLOR: #008080">22</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">>&</span><span style="COLOR: #000000"> Push(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> T </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">val);<br></span><span style="COLOR: #008080">23</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">>&</span><span style="COLOR: #000000"> Pop(T </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">e);<br></span><span style="COLOR: #008080">24</span><span style="COLOR: #000000"><img id=Codehighlighter1_340_358_Open_Image onclick="this.style.display='none'; Codehighlighter1_340_358_Open_Text.style.display='none'; Codehighlighter1_340_358_Closed_Image.style.display='inline'; Codehighlighter1_340_358_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_340_358_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_340_358_Closed_Text.style.display='none'; Codehighlighter1_340_358_Open_Image.style.display='inline'; Codehighlighter1_340_358_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    T</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000"> GetTop() </span><span style="COLOR: #0000ff">const</span><span id=Codehighlighter1_340_358_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_340_358_Open_Text><span style="COLOR: #000000">{</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> Top</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">data;}</span></span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">25</span><span style="COLOR: #000000"><img id=Codehighlighter1_379_393_Open_Image onclick="this.style.display='none'; Codehighlighter1_379_393_Open_Text.style.display='none'; Codehighlighter1_379_393_Closed_Image.style.display='inline'; Codehighlighter1_379_393_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_379_393_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_379_393_Closed_Text.style.display='none'; Codehighlighter1_379_393_Open_Image.style.display='inline'; Codehighlighter1_379_393_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> Size() </span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> </span><span id=Codehighlighter1_379_393_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_379_393_Open_Text><span style="COLOR: #000000">{</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> _Size;}</span></span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">26</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    <br></span><span style="COLOR: #008080">27</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">:<br></span><span style="COLOR: #008080">28</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> _Size;<br></span><span style="COLOR: #008080">29</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    Node</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">  </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">Top;<br></span><span style="COLOR: #008080">30</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    <br></span><span style="COLOR: #008080">31</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">32</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">-----------------------------------------------------------</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">33</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">34</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">::Stack()<br></span><span style="COLOR: #008080">35</span><span style="COLOR: #000000"><img id=Codehighlighter1_541_564_Open_Image onclick="this.style.display='none'; Codehighlighter1_541_564_Open_Text.style.display='none'; Codehighlighter1_541_564_Closed_Image.style.display='inline'; Codehighlighter1_541_564_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_541_564_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_541_564_Closed_Text.style.display='none'; Codehighlighter1_541_564_Open_Image.style.display='inline'; Codehighlighter1_541_564_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_541_564_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_541_564_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">36</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    Top</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">NULL;<br></span><span style="COLOR: #008080">37</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    _Size</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">38</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">39</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080">40</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">-----------------------------------------------------------</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">41</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">42</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000"> Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">::IsEmpty()<br></span><span style="COLOR: #008080">43</span><span style="COLOR: #000000"><img id=Codehighlighter1_672_699_Open_Image onclick="this.style.display='none'; Codehighlighter1_672_699_Open_Text.style.display='none'; Codehighlighter1_672_699_Closed_Image.style.display='inline'; Codehighlighter1_672_699_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_672_699_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_672_699_Closed_Text.style.display='none'; Codehighlighter1_672_699_Open_Image.style.display='inline'; Codehighlighter1_672_699_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_672_699_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_672_699_Open_Text><span style="COLOR: #000000">{    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">!</span><span style="COLOR: #000000">Top</span><span style="COLOR: #000000">?</span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">:</span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">44</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080">45</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">46</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">-----------------------------------------------------------</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">47</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">48</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">::</span><span style="COLOR: #000000">~</span><span style="COLOR: #000000">Stack()<br></span><span style="COLOR: #008080">49</span><span style="COLOR: #000000"><img id=Codehighlighter1_800_887_Open_Image onclick="this.style.display='none'; Codehighlighter1_800_887_Open_Text.style.display='none'; Codehighlighter1_800_887_Closed_Image.style.display='inline'; Codehighlighter1_800_887_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_800_887_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_800_887_Closed_Text.style.display='none'; Codehighlighter1_800_887_Open_Image.style.display='inline'; Codehighlighter1_800_887_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_800_887_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_800_887_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">50</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    Node</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">>*</span><span style="COLOR: #000000"> move</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">NULL;<br></span><span style="COLOR: #008080">51</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">(Top)<br></span><span style="COLOR: #008080">52</span><span style="COLOR: #000000"><img id=Codehighlighter1_836_883_Open_Image onclick="this.style.display='none'; Codehighlighter1_836_883_Open_Text.style.display='none'; Codehighlighter1_836_883_Closed_Image.style.display='inline'; Codehighlighter1_836_883_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_836_883_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_836_883_Closed_Text.style.display='none'; Codehighlighter1_836_883_Open_Image.style.display='inline'; Codehighlighter1_836_883_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span id=Codehighlighter1_836_883_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_836_883_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">53</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        move</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">Top</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">next;<br></span><span style="COLOR: #008080">54</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        delete Top;<br></span><span style="COLOR: #008080">55</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        Top</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">move;<br></span><span style="COLOR: #008080">56</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">57</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    <br></span><span style="COLOR: #008080">58</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">59</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">-----------------------------------------------------------</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">60</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">61</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">>&</span><span style="COLOR: #000000"> Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">::Push(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> T </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">val)<br></span><span style="COLOR: #008080">62</span><span style="COLOR: #000000"><img id=Codehighlighter1_1008_1109_Open_Image onclick="this.style.display='none'; Codehighlighter1_1008_1109_Open_Text.style.display='none'; Codehighlighter1_1008_1109_Closed_Image.style.display='inline'; Codehighlighter1_1008_1109_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_1008_1109_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1008_1109_Closed_Text.style.display='none'; Codehighlighter1_1008_1109_Open_Image.style.display='inline'; Codehighlighter1_1008_1109_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_1008_1109_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_1008_1109_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">63</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    <br></span><span style="COLOR: #008080">64</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    Node</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">NewNode </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> Node</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">(val);<br></span><span style="COLOR: #008080">65</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    NewNode</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">next</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">Top;<br></span><span style="COLOR: #008080">66</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    Top</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">NewNode;<br></span><span style="COLOR: #008080">67</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">_Size;<br></span><span style="COLOR: #008080">68</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">69</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">70</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">-----------------------------------------------------------</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">71</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">72</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">>&</span><span style="COLOR: #000000"> Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">::Pop(T </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">e)<br></span><span style="COLOR: #008080">73</span><span style="COLOR: #000000"><img id=Codehighlighter1_1221_1345_Open_Image onclick="this.style.display='none'; Codehighlighter1_1221_1345_Open_Text.style.display='none'; Codehighlighter1_1221_1345_Closed_Image.style.display='inline'; Codehighlighter1_1221_1345_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_1221_1345_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1221_1345_Closed_Text.style.display='none'; Codehighlighter1_1221_1345_Open_Image.style.display='inline'; Codehighlighter1_1221_1345_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_1221_1345_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_1221_1345_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">74</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(Top</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">NULL) </span><span style="COLOR: #0000ff">throw</span><span style="COLOR: #000000"> exception(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">鏍堜笅婧?/span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080">75</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    e</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">Top</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">data;<br></span><span style="COLOR: #008080">76</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    Node</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">Top;<br></span><span style="COLOR: #008080">77</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    Top</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">Top</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">next;<br></span><span style="COLOR: #008080">78</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    delete p;<br></span><span style="COLOR: #008080">79</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #000000">--</span><span style="COLOR: #000000">_Size;<br></span><span style="COLOR: #008080">80</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">81</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">82</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080">83</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080">84</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">#endif</span></div> <img src ="http://www.shnenglu.com/xingkongyun/aggbug/62298.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/xingkongyun/" target="_blank">鏉ㄥ漿褰?/a> 2008-09-19 19:09 <a href="http://www.shnenglu.com/xingkongyun/articles/62298.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鏍堢粨鏋勭畝鍗曞疄鐜幫紙鍩轟簬鏁扮粍錛?/title><link>http://www.shnenglu.com/xingkongyun/articles/62297.html</link><dc:creator>鏉ㄥ漿褰?/dc:creator><author>鏉ㄥ漿褰?/author><pubDate>Fri, 19 Sep 2008 10:43:00 GMT</pubDate><guid>http://www.shnenglu.com/xingkongyun/articles/62297.html</guid><wfw:comment>http://www.shnenglu.com/xingkongyun/comments/62297.html</wfw:comment><comments>http://www.shnenglu.com/xingkongyun/articles/62297.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/xingkongyun/comments/commentRss/62297.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/xingkongyun/services/trackbacks/62297.html</trackback:ping><description><![CDATA[<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080"> 1</span><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鏁版嵁緇撴瀯鍫嗘爤瀹炵幇錛堝熀浜庢暟緇勶級</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080"> 2</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">#ifndef STACK_H<br></span><span style="COLOR: #008080"> 3</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> STACK_H</span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 4</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>template</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 5</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> Stack<br></span><span style="COLOR: #008080"> 6</span><span style="COLOR: #000000"><img id=Codehighlighter1_79_314_Open_Image onclick="this.style.display='none'; Codehighlighter1_79_314_Open_Text.style.display='none'; Codehighlighter1_79_314_Closed_Image.style.display='inline'; Codehighlighter1_79_314_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_79_314_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_79_314_Closed_Text.style.display='none'; Codehighlighter1_79_314_Open_Image.style.display='inline'; Codehighlighter1_79_314_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_79_314_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_79_314_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 7</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br></span><span style="COLOR: #008080"> 8</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>Stack(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> maxsize</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">50</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080"> 9</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">virtual</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">~</span><span style="COLOR: #000000">Stack();<br></span><span style="COLOR: #008080">10</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000"> IsEmpty();<br></span><span style="COLOR: #008080">11</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">>&</span><span style="COLOR: #000000"> Push(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> T </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">val);<br></span><span style="COLOR: #008080">12</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">>&</span><span style="COLOR: #000000"> Pop(T </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">e);<br></span><span style="COLOR: #008080">13</span><span style="COLOR: #000000"><img id=Codehighlighter1_214_232_Open_Image onclick="this.style.display='none'; Codehighlighter1_214_232_Open_Text.style.display='none'; Codehighlighter1_214_232_Closed_Image.style.display='inline'; Codehighlighter1_214_232_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_214_232_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_214_232_Closed_Text.style.display='none'; Codehighlighter1_214_232_Open_Image.style.display='inline'; Codehighlighter1_214_232_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>T</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000"> GetTop() </span><span style="COLOR: #0000ff">const</span><span id=Codehighlighter1_214_232_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_214_232_Open_Text><span style="COLOR: #000000">{</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> Data[Top];}</span></span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">14</span><span style="COLOR: #000000"><img id=Codehighlighter1_252_266_Open_Image onclick="this.style.display='none'; Codehighlighter1_252_266_Open_Text.style.display='none'; Codehighlighter1_252_266_Closed_Image.style.display='inline'; Codehighlighter1_252_266_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_252_266_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_252_266_Closed_Text.style.display='none'; Codehighlighter1_252_266_Open_Image.style.display='inline'; Codehighlighter1_252_266_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> Size() </span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> </span><span id=Codehighlighter1_252_266_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_252_266_Open_Text><span style="COLOR: #000000">{</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> Top</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;}</span></span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">15</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080">16</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">:<br></span><span style="COLOR: #008080">17</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    T </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">Data;<br></span><span style="COLOR: #008080">18</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> MaxSize;<br></span><span style="COLOR: #008080">19</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> Top;<br></span><span style="COLOR: #008080">20</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080">21</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">22</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080">23</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080">24</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">-----------------------------------------------------------</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">25</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">26</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">::Stack(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> maxsize)<br></span><span style="COLOR: #008080">27</span><span style="COLOR: #000000"><img id=Codehighlighter1_428_476_Open_Image onclick="this.style.display='none'; Codehighlighter1_428_476_Open_Text.style.display='none'; Codehighlighter1_428_476_Closed_Image.style.display='inline'; Codehighlighter1_428_476_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_428_476_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_428_476_Closed_Text.style.display='none'; Codehighlighter1_428_476_Open_Image.style.display='inline'; Codehighlighter1_428_476_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_428_476_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_428_476_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">28</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>MaxSize</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">maxsize;<br></span><span style="COLOR: #008080">29</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>Data</span><span style="COLOR: #000000">=</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> T[MaxSize];<br></span><span style="COLOR: #008080">30</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>Top</span><span style="COLOR: #000000">=-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">31</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">32</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080">33</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">-----------------------------------------------------------</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">34</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">35</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000"> Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">::IsEmpty()<br></span><span style="COLOR: #008080">36</span><span style="COLOR: #000000"><img id=Codehighlighter1_584_614_Open_Image onclick="this.style.display='none'; Codehighlighter1_584_614_Open_Text.style.display='none'; Codehighlighter1_584_614_Closed_Image.style.display='inline'; Codehighlighter1_584_614_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_584_614_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_584_614_Closed_Text.style.display='none'; Codehighlighter1_584_614_Open_Image.style.display='inline'; Codehighlighter1_584_614_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_584_614_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_584_614_Open_Text><span style="COLOR: #000000">{    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> Top</span><span style="COLOR: #000000">==-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">?</span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">:</span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">37</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080">38</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">39</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">-----------------------------------------------------------</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">40</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">41</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">::</span><span style="COLOR: #000000">~</span><span style="COLOR: #000000">Stack()<br></span><span style="COLOR: #008080">42</span><span style="COLOR: #000000"><img id=Codehighlighter1_715_733_Open_Image onclick="this.style.display='none'; Codehighlighter1_715_733_Open_Text.style.display='none'; Codehighlighter1_715_733_Closed_Image.style.display='inline'; Codehighlighter1_715_733_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_715_733_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_715_733_Closed_Text.style.display='none'; Codehighlighter1_715_733_Open_Image.style.display='inline'; Codehighlighter1_715_733_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_715_733_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_715_733_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">43</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>delete[] Data; <br></span><span style="COLOR: #008080">44</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">45</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">-----------------------------------------------------------</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">46</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">47</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">>&</span><span style="COLOR: #000000"> Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">::Push(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> T </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">val)<br></span><span style="COLOR: #008080">48</span><span style="COLOR: #000000"><img id=Codehighlighter1_854_930_Open_Image onclick="this.style.display='none'; Codehighlighter1_854_930_Open_Text.style.display='none'; Codehighlighter1_854_930_Closed_Image.style.display='inline'; Codehighlighter1_854_930_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_854_930_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_854_930_Closed_Text.style.display='none'; Codehighlighter1_854_930_Open_Image.style.display='inline'; Codehighlighter1_854_930_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_854_930_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_854_930_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">49</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(Top</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">MaxSize</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">) </span><span style="COLOR: #0000ff">throw</span><span style="COLOR: #000000"> exception(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">鏍堜笂婧?/span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080">50</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>Data[</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">Top]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">val;<br></span><span style="COLOR: #008080">51</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">52</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">53</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">-----------------------------------------------------------</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">54</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">55</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">>&</span><span style="COLOR: #000000"> Stack</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">::Pop(T </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">e)<br></span><span style="COLOR: #008080">56</span><span style="COLOR: #000000"><img id=Codehighlighter1_1042_1109_Open_Image onclick="this.style.display='none'; Codehighlighter1_1042_1109_Open_Text.style.display='none'; Codehighlighter1_1042_1109_Closed_Image.style.display='inline'; Codehighlighter1_1042_1109_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_1042_1109_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1042_1109_Closed_Text.style.display='none'; Codehighlighter1_1042_1109_Open_Image.style.display='inline'; Codehighlighter1_1042_1109_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_1042_1109_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_1042_1109_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">57</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(Top</span><span style="COLOR: #000000">==-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">) </span><span style="COLOR: #0000ff">throw</span><span style="COLOR: #000000"> exception(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">鏍堜笅婧?/span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #008080">58</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>e</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">Data[Top</span><span style="COLOR: #000000">--</span><span style="COLOR: #000000">];<br></span><span style="COLOR: #008080">59</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">60</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">61</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">#endif</span></div> <img src ="http://www.shnenglu.com/xingkongyun/aggbug/62297.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/xingkongyun/" target="_blank">鏉ㄥ漿褰?/a> 2008-09-19 18:43 <a href="http://www.shnenglu.com/xingkongyun/articles/62297.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍗曞悜甯﹀ご緇撶偣寰幆閾捐〃瀹炵幇http://www.shnenglu.com/xingkongyun/articles/62221.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Thu, 18 Sep 2008 12:54:00 GMThttp://www.shnenglu.com/xingkongyun/articles/62221.htmlhttp://www.shnenglu.com/xingkongyun/comments/62221.htmlhttp://www.shnenglu.com/xingkongyun/articles/62221.html#Feedback0http://www.shnenglu.com/xingkongyun/comments/commentRss/62221.htmlhttp://www.shnenglu.com/xingkongyun/services/trackbacks/62221.html闃呰鍏ㄦ枃

]]>
鍏充簬綰㈤粦鏍?wèi)锛坮-b鏍?wèi)锛夌殑鐩稿厡櫟勬?/title><link>http://www.shnenglu.com/xingkongyun/articles/62192.html</link><dc:creator>鏉ㄥ漿褰?/dc:creator><author>鏉ㄥ漿褰?/author><pubDate>Thu, 18 Sep 2008 09:20:00 GMT</pubDate><guid>http://www.shnenglu.com/xingkongyun/articles/62192.html</guid><wfw:comment>http://www.shnenglu.com/xingkongyun/comments/62192.html</wfw:comment><comments>http://www.shnenglu.com/xingkongyun/articles/62192.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/xingkongyun/comments/commentRss/62192.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/xingkongyun/services/trackbacks/62192.html</trackback:ping><description><![CDATA[<p><a title=鍏充簬綰㈤粦鏍?wèi)锛坮-b鏍?wèi)锛夌殑鐩稿厡櫟勬?href="http://www.shnenglu.com/Files/xingkongyun/rbavl.pdf">鍏充簬綰㈤粦鏍?wèi)锛坮-b鏍?wèi)锛夌殑鐩稿厡櫟勬?/a> </p> <img src ="http://www.shnenglu.com/xingkongyun/aggbug/62192.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/xingkongyun/" target="_blank">鏉ㄥ漿褰?/a> 2008-09-18 17:20 <a href="http://www.shnenglu.com/xingkongyun/articles/62192.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>浜屽弶鎼滅儲鏍?wèi)瀹炵?/title><link>http://www.shnenglu.com/xingkongyun/articles/62190.html</link><dc:creator>鏉ㄥ漿褰?/dc:creator><author>鏉ㄥ漿褰?/author><pubDate>Thu, 18 Sep 2008 09:17:00 GMT</pubDate><guid>http://www.shnenglu.com/xingkongyun/articles/62190.html</guid><wfw:comment>http://www.shnenglu.com/xingkongyun/comments/62190.html</wfw:comment><comments>http://www.shnenglu.com/xingkongyun/articles/62190.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/xingkongyun/comments/commentRss/62190.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/xingkongyun/services/trackbacks/62190.html</trackback:ping><description><![CDATA[浜屽弶鎼滅儲鏍?wèi)瀹炵?緇ф壙浜庝簩鍙夋爲(wèi))<br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080">  1</span><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">#include </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">BinTree.h</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">  2</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080">  3</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>template</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> K,</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> E</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">  4</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> BinSearchTree:</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> BinTree</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">E</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">  5</span><span style="COLOR: #000000"><img id=Codehighlighter1_86_268_Open_Image onclick="this.style.display='none'; Codehighlighter1_86_268_Open_Text.style.display='none'; Codehighlighter1_86_268_Closed_Image.style.display='inline'; Codehighlighter1_86_268_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_86_268_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_86_268_Closed_Text.style.display='none'; Codehighlighter1_86_268_Open_Image.style.display='inline'; Codehighlighter1_86_268_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_86_268_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_86_268_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">  6</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br></span><span style="COLOR: #008080">  7</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000"> Search(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> K </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">k,E </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">e);</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">浠ュ叧閿瓧K榪涜鎼滅儲錛岀粨鏋滆繑鍥炲埌e涓?/span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">  8</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    BinSearchTree</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">K,E</span><span style="COLOR: #000000">>&</span><span style="COLOR: #000000"> Insert(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> E </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">e);</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">灝嗗厓绱爀鎻掑叆鍒版爲(wèi)涓?/span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">  9</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    BinSearchTree</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">K,E</span><span style="COLOR: #000000">>&</span><span style="COLOR: #000000"> Delete(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> K </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">k,E </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">e);</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">閫氳繃鎸囧畾鍏抽敭瀛梜榪涜鑺傜偣鐨勫垹闄?/span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080"> 10</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 11</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080"> 12</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080"> 13</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">----------------------------------------------------------</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080"> 14</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> K,</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> E</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 15</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000"> BinSearchTree</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">K,E</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">::Search(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> K </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">k,E </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">e)<br></span><span style="COLOR: #008080"> 16</span><span style="COLOR: #000000"><img id=Codehighlighter1_408_567_Open_Image onclick="this.style.display='none'; Codehighlighter1_408_567_Open_Text.style.display='none'; Codehighlighter1_408_567_Closed_Image.style.display='inline'; Codehighlighter1_408_567_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_408_567_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_408_567_Closed_Text.style.display='none'; Codehighlighter1_408_567_Open_Image.style.display='inline'; Codehighlighter1_408_567_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_408_567_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_408_567_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 17</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080"> 18</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>BinTreeNode</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">E</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">root;<br></span><span style="COLOR: #008080"> 19</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">(p)<br></span><span style="COLOR: #008080"> 20</span><span style="COLOR: #000000"><img id=Codehighlighter1_444_551_Open_Image onclick="this.style.display='none'; Codehighlighter1_444_551_Open_Text.style.display='none'; Codehighlighter1_444_551_Closed_Image.style.display='inline'; Codehighlighter1_444_551_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_444_551_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_444_551_Closed_Text.style.display='none'; Codehighlighter1_444_551_Open_Image.style.display='inline'; Codehighlighter1_444_551_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span id=Codehighlighter1_444_551_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_444_551_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 21</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(k</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">data)<br></span><span style="COLOR: #008080"> 22</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>p</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">LeftChild;<br></span><span style="COLOR: #008080"> 23</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(k</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">data)<br></span><span style="COLOR: #008080"> 24</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>p</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">RightChild;<br></span><span style="COLOR: #008080"> 25</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">else</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鎵懼埌鍏冪礌</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080"> 26</span><span style="COLOR: #008000"><img id=Codehighlighter1_523_549_Open_Image onclick="this.style.display='none'; Codehighlighter1_523_549_Open_Text.style.display='none'; Codehighlighter1_523_549_Closed_Image.style.display='inline'; Codehighlighter1_523_549_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_523_549_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_523_549_Closed_Text.style.display='none'; Codehighlighter1_523_549_Open_Image.style.display='inline'; Codehighlighter1_523_549_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span id=Codehighlighter1_523_549_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_523_549_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 27</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>e</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">data;<br></span><span style="COLOR: #008080"> 28</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080"> 29</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 30</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 31</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080"> 32</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 33</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">----------------------------------------------------------</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080"> 34</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> K,</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> E</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 35</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>BinSearchTree</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">K,E</span><span style="COLOR: #000000">>&</span><span style="COLOR: #000000"> BinSearchTree</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">K,E</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">::Insert(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> E </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">e)<br></span><span style="COLOR: #008080"> 36</span><span style="COLOR: #000000"><img id=Codehighlighter1_715_987_Open_Image onclick="this.style.display='none'; Codehighlighter1_715_987_Open_Text.style.display='none'; Codehighlighter1_715_987_Closed_Image.style.display='inline'; Codehighlighter1_715_987_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_715_987_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_715_987_Closed_Text.style.display='none'; Codehighlighter1_715_987_Open_Image.style.display='inline'; Codehighlighter1_715_987_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_715_987_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_715_987_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 37</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080"> 38</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>BinTreeNode</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">E</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">root,</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">pp</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">NULL;<br></span><span style="COLOR: #008080"> 39</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">(p)<br></span><span style="COLOR: #008080"> 40</span><span style="COLOR: #000000"><img id=Codehighlighter1_760_821_Open_Image onclick="this.style.display='none'; Codehighlighter1_760_821_Open_Text.style.display='none'; Codehighlighter1_760_821_Closed_Image.style.display='inline'; Codehighlighter1_760_821_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_760_821_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_760_821_Closed_Text.style.display='none'; Codehighlighter1_760_821_Open_Image.style.display='inline'; Codehighlighter1_760_821_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span id=Codehighlighter1_760_821_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_760_821_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 41</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>pp</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">p;<br></span><span style="COLOR: #008080"> 42</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(e</span><span style="COLOR: #000000"><=</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">data)<br></span><span style="COLOR: #008080"> 43</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>p</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">LeftChild;<br></span><span style="COLOR: #008080"> 44</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 45</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>p</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">RightChild;<br></span><span style="COLOR: #008080"> 46</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 47</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080"> 48</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>BinTreeNode</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">E</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">NewNode</span><span style="COLOR: #000000">=</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> BinTreeNode</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">E</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">(e);<br></span><span style="COLOR: #008080"> 49</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(root)<br></span><span style="COLOR: #008080"> 50</span><span style="COLOR: #000000"><img id=Codehighlighter1_880_950_Open_Image onclick="this.style.display='none'; Codehighlighter1_880_950_Open_Text.style.display='none'; Codehighlighter1_880_950_Closed_Image.style.display='inline'; Codehighlighter1_880_950_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_880_950_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_880_950_Closed_Text.style.display='none'; Codehighlighter1_880_950_Open_Image.style.display='inline'; Codehighlighter1_880_950_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span id=Codehighlighter1_880_950_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_880_950_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 51</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(e</span><span style="COLOR: #000000"><=</span><span style="COLOR: #000000">pp</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">data)<br></span><span style="COLOR: #008080"> 52</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>pp</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">LeftChild</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">NewNode;<br></span><span style="COLOR: #008080"> 53</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 54</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>pp</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">RightChild</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">NewNode;<br></span><span style="COLOR: #008080"> 55</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 56</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 57</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>  root</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">NewNode;<br></span><span style="COLOR: #008080"> 58</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080"> 59</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 60</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080"> 61</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">----------------------------------------------------------</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080"> 62</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> K,</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> E</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 63</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>BinSearchTree</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">K,E</span><span style="COLOR: #000000">>&</span><span style="COLOR: #000000"> BinSearchTree</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">K,E</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">::Delete(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> K </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">k,E </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">e)<br></span><span style="COLOR: #008080"> 64</span><span style="COLOR: #000000"><img id=Codehighlighter1_1141_1669_Open_Image onclick="this.style.display='none'; Codehighlighter1_1141_1669_Open_Text.style.display='none'; Codehighlighter1_1141_1669_Closed_Image.style.display='inline'; Codehighlighter1_1141_1669_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_1141_1669_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1141_1669_Closed_Text.style.display='none'; Codehighlighter1_1141_1669_Open_Image.style.display='inline'; Codehighlighter1_1141_1669_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_1141_1669_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_1141_1669_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 65</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>BinTreeNode</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">E</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">root,</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">pp</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">NULL;<br></span><span style="COLOR: #008080"> 66</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080"> 67</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">(p</span><span style="COLOR: #000000">&&</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">data</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">k)<br></span><span style="COLOR: #008080"> 68</span><span style="COLOR: #000000"><img id=Codehighlighter1_1198_1258_Open_Image onclick="this.style.display='none'; Codehighlighter1_1198_1258_Open_Text.style.display='none'; Codehighlighter1_1198_1258_Closed_Image.style.display='inline'; Codehighlighter1_1198_1258_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1198_1258_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1198_1258_Closed_Text.style.display='none'; Codehighlighter1_1198_1258_Open_Image.style.display='inline'; Codehighlighter1_1198_1258_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span id=Codehighlighter1_1198_1258_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_1198_1258_Open_Text><span style="COLOR: #000000">{pp</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">p;<br></span><span style="COLOR: #008080"> 69</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(k</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">data)  p</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">LeftChild;<br></span><span style="COLOR: #008080"> 70</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"> p</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">RightChild;<br></span><span style="COLOR: #008080"> 71</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 72</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080"> 73</span><span style="COLOR: #000000"><img id=Codehighlighter1_1268_1297_Open_Image onclick="this.style.display='none'; Codehighlighter1_1268_1297_Open_Text.style.display='none'; Codehighlighter1_1268_1297_Closed_Image.style.display='inline'; Codehighlighter1_1268_1297_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1268_1297_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1268_1297_Closed_Text.style.display='none'; Codehighlighter1_1268_1297_Open_Image.style.display='inline'; Codehighlighter1_1268_1297_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">!</span><span style="COLOR: #000000">p) </span><span id=Codehighlighter1_1268_1297_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_1268_1297_Open_Text><span style="COLOR: #000000">{</span><span style="COLOR: #0000ff">throw</span><span style="COLOR: #000000"> exception(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">娌℃湁鎵懼埌鎸囧畾鍏冪礌</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 74</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>e</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">data;<br></span><span style="COLOR: #008080"> 75</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">LeftChild</span><span style="COLOR: #000000">&&</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">RightChild)</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">p鐨勫乏鍙沖瀛愬潎涓嶄負(fù)絀?/span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080"> 76</span><span style="COLOR: #008000"><img id=Codehighlighter1_1354_1472_Open_Image onclick="this.style.display='none'; Codehighlighter1_1354_1472_Open_Text.style.display='none'; Codehighlighter1_1354_1472_Closed_Image.style.display='inline'; Codehighlighter1_1354_1472_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1354_1472_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1354_1472_Closed_Text.style.display='none'; Codehighlighter1_1354_1472_Open_Image.style.display='inline'; Codehighlighter1_1354_1472_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span id=Codehighlighter1_1354_1472_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_1354_1472_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 77</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>BinTreeNode</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">E</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">s</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">LeftChild,</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">ps</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">p;<br></span><span style="COLOR: #008080"> 78</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">(s</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">RightChild)<br></span><span style="COLOR: #008080"> 79</span><span style="COLOR: #000000"><img id=Codehighlighter1_1415_1440_Open_Image onclick="this.style.display='none'; Codehighlighter1_1415_1440_Open_Text.style.display='none'; Codehighlighter1_1415_1440_Closed_Image.style.display='inline'; Codehighlighter1_1415_1440_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1415_1440_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1415_1440_Closed_Text.style.display='none'; Codehighlighter1_1415_1440_Open_Image.style.display='inline'; Codehighlighter1_1415_1440_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span id=Codehighlighter1_1415_1440_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_1415_1440_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 80</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>ps</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">s;<br></span><span style="COLOR: #008080"> 81</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>s</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">s</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">RightChild;<br></span><span style="COLOR: #008080"> 82</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 83</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080"> 84</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">data</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">s</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">data;<br></span><span style="COLOR: #008080"> 85</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>p</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">s;<br></span><span style="COLOR: #008080"> 86</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>pp</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">ps;<br></span><span style="COLOR: #008080"> 87</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</span></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">if</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080"> 88</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">BinTreeNode</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">E</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">c;<br></span><span style="COLOR: #008080"> 89</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">LeftChild) c</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">LeftChild;<br></span><span style="COLOR: #008080"> 90</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"> c</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">RightChild;<br></span><span style="COLOR: #008080"> 91</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080"> 92</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(p</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">root) root</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">c;<br></span><span style="COLOR: #008080"> 93</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 94</span><span style="COLOR: #000000"><img id=Codehighlighter1_1578_1642_Open_Image onclick="this.style.display='none'; Codehighlighter1_1578_1642_Open_Text.style.display='none'; Codehighlighter1_1578_1642_Closed_Image.style.display='inline'; Codehighlighter1_1578_1642_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1578_1642_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1578_1642_Closed_Text.style.display='none'; Codehighlighter1_1578_1642_Open_Image.style.display='inline'; Codehighlighter1_1578_1642_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span id=Codehighlighter1_1578_1642_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_1578_1642_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080"> 95</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080"> 96</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(p</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">pp</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">LeftChild) pp</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">LeftChild</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">c;<br></span><span style="COLOR: #008080"> 97</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"> pp</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">RightChild</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">c;<br></span><span style="COLOR: #008080"> 98</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080"> 99</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>delete p;<br></span><span style="COLOR: #008080">100</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080">101</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">102</span><span style="COLOR: #000000"><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span></div> <img src ="http://www.shnenglu.com/xingkongyun/aggbug/62190.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/xingkongyun/" target="_blank">鏉ㄥ漿褰?/a> 2008-09-18 17:17 <a href="http://www.shnenglu.com/xingkongyun/articles/62190.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>浜屽弶鏍?wèi)瀹炵?/title><link>http://www.shnenglu.com/xingkongyun/articles/62187.html</link><dc:creator>鏉ㄥ漿褰?/dc:creator><author>鏉ㄥ漿褰?/author><pubDate>Thu, 18 Sep 2008 09:14:00 GMT</pubDate><guid>http://www.shnenglu.com/xingkongyun/articles/62187.html</guid><wfw:comment>http://www.shnenglu.com/xingkongyun/comments/62187.html</wfw:comment><comments>http://www.shnenglu.com/xingkongyun/articles/62187.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/xingkongyun/comments/commentRss/62187.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/xingkongyun/services/trackbacks/62187.html</trackback:ping><description><![CDATA[     鎽樿: 浜屽弶鏍?wèi)瀹炵帋图堜富瑕佹槸湄?fù)浜嗗疄鐜頒簩鍙夋悳绱㈡爲(wèi)鏃朵綔涓哄叾鐖剁被錛?  1//瀹炵幇浜屽弶鏍?wèi)鏁版嵁缁撴?nbsp; 2#ifndef BINTREE_H  3#define BINTREE_H  4  5  6//瀹氫箟鑺傜偣緇撴瀯  7template<class&n...  <a href='http://www.shnenglu.com/xingkongyun/articles/62187.html'>闃呰鍏ㄦ枃</a><img src ="http://www.shnenglu.com/xingkongyun/aggbug/62187.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/xingkongyun/" target="_blank">鏉ㄥ漿褰?/a> 2008-09-18 17:14 <a href="http://www.shnenglu.com/xingkongyun/articles/62187.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鏈澶ч珮搴︿紭鍏堝乏楂樻爲(wèi)錛圚BLT錛夊疄鐜?/title><link>http://www.shnenglu.com/xingkongyun/articles/62107.html</link><dc:creator>鏉ㄥ漿褰?/dc:creator><author>鏉ㄥ漿褰?/author><pubDate>Wed, 17 Sep 2008 13:32:00 GMT</pubDate><guid>http://www.shnenglu.com/xingkongyun/articles/62107.html</guid><wfw:comment>http://www.shnenglu.com/xingkongyun/comments/62107.html</wfw:comment><comments>http://www.shnenglu.com/xingkongyun/articles/62107.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/xingkongyun/comments/commentRss/62107.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/xingkongyun/services/trackbacks/62107.html</trackback:ping><description><![CDATA[     鎽樿: HBLT鍙敤浜庡疄鐜頒紭鍏堢駭闃熷垪錛屽茍鍙疄鐜頒袱涓紭鍏堢駭闃熷垪鐨勫悎騫舵搷浣? (濡傚彂鐜伴敊璇鐣欒█)   1//楂樺害浼樺厛宸﹂珮鏍?HBLT)瀹炵幇  2#ifndef HBLT_H  3#define HBLT_H  4#include <queue>  5//瀹氫箟HBLT...  <a href='http://www.shnenglu.com/xingkongyun/articles/62107.html'>闃呰鍏ㄦ枃</a><img src ="http://www.shnenglu.com/xingkongyun/aggbug/62107.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/xingkongyun/" target="_blank">鏉ㄥ漿褰?/a> 2008-09-17 21:32 <a href="http://www.shnenglu.com/xingkongyun/articles/62107.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鏈澶у爢瀹炵幇http://www.shnenglu.com/xingkongyun/articles/62098.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Wed, 17 Sep 2008 11:49:00 GMThttp://www.shnenglu.com/xingkongyun/articles/62098.htmlhttp://www.shnenglu.com/xingkongyun/comments/62098.htmlhttp://www.shnenglu.com/xingkongyun/articles/62098.html#Feedback0http://www.shnenglu.com/xingkongyun/comments/commentRss/62098.htmlhttp://www.shnenglu.com/xingkongyun/services/trackbacks/62098.html闃呰鍏ㄦ枃

]]>
閾捐〃綾?--杞澆http://www.shnenglu.com/xingkongyun/articles/53928.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Wed, 18 Jun 2008 14:05:00 GMThttp://www.shnenglu.com/xingkongyun/articles/53928.htmlhttp://www.shnenglu.com/xingkongyun/comments/53928.htmlhttp://www.shnenglu.com/xingkongyun/articles/53928.html#Feedback0http://www.shnenglu.com/xingkongyun/comments/commentRss/53928.htmlhttp://www.shnenglu.com/xingkongyun/services/trackbacks/53928.html闃呰鍏ㄦ枃

]]>
亚洲国产另类久久久精品黑人| 免费观看久久精彩视频| 久久这里都是精品| 99久久国产综合精品女同图片| 亚洲AV成人无码久久精品老人| 久久精品蜜芽亚洲国产AV| 久久综合九色综合97_久久久| 国内精品久久久久国产盗摄| 亚洲人成无码网站久久99热国产| 亚洲精品美女久久777777| 久久99精品国产麻豆宅宅| 久久久久人妻一区精品| 亚洲AV日韩精品久久久久| 久久久久一区二区三区| 久久综合成人网| 99久久精品国产高清一区二区| 久久精品国产一区二区电影| 亚洲第一极品精品无码久久 | 亚洲欧美国产精品专区久久| 无码国内精品久久人妻蜜桃| 国产99久久久国产精免费| 久久人人爽人人爽人人片av麻烦| 国产午夜精品理论片久久影视| 久久久久久国产精品免费免费| 久久亚洲精品人成综合网 | 国产成人精品综合久久久| 久久狠狠色狠狠色综合| 久久AV高潮AV无码AV| 久久国产精品二国产精品| 精品熟女少妇a∨免费久久| 香蕉久久永久视频| 国产成人精品久久一区二区三区av | 99久久er这里只有精品18| 中文字幕久久精品| 国产精品gz久久久| 97r久久精品国产99国产精| 久久久SS麻豆欧美国产日韩| 激情久久久久久久久久| AV狠狠色丁香婷婷综合久久| 亚洲精品无码久久久影院相关影片 | 久久亚洲国产中v天仙www|