锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产午夜精品久久久久免费视,亚洲国产欧美国产综合久久,一本一道久久a久久精品综合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
5
template<class T>
6
class Queue
7

{
8
public:
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
19
private:
20
T *data;
21
int front,rear;
22
int MaxSize;
23
int _Size;
24
};
25
//------------------------------------------------
26
template<class T>
27
Queue<T>::Queue(int maxsize)
28

{
29
data=new T[maxsize+1];
30
MaxSize=maxsize+1;
31
front=rear=_Size=0;
32
33
}
34
//------------------------------------------------
35
template<class T>
36
Queue<T>::~Queue()
37

{
38
delete[] data;
39
}
40
//------------------------------------------------
41
template<class T>
42
Queue<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
//------------------------------------------------
51
template<class T>
52
Queue<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
//------------------------------------------------
61
template<class T>
62
T& Queue<T>::Front()
63

{
64
if(IsEmpty()) throw exception("闃熷垪宸茬┖");
65
return data[(front+1)%MaxSize];
66
67
}
68
//------------------------------------------------
69
template<class T>
70
T& Queue<T>::Back()
71

{
72
if(IsEmpty()) throw exception("闃熷垪宸茬┖");
73
return data[rear];
74
75
}
76
#endif

]]> - 鏁版嵁緇撴瀯鏍堢畝鍗曞疄鐜幫紙鍩轟簬閾捐〃錛?/title>http://www.shnenglu.com/xingkongyun/articles/62298.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Fri, 19 Sep 2008 11:09:00 GMThttp://www.shnenglu.com/xingkongyun/articles/62298.htmlhttp://www.shnenglu.com/xingkongyun/comments/62298.htmlhttp://www.shnenglu.com/xingkongyun/articles/62298.html#Feedback0http://www.shnenglu.com/xingkongyun/comments/commentRss/62298.htmlhttp://www.shnenglu.com/xingkongyun/services/trackbacks/62298.html 1
//鏁版嵁緇撴瀯鏍堝疄鐜幫紙鍩轟簬閾捐〃錛?/span>
2
#ifndef STACKLIST_H
3
#define STACKLIST_H
4
//鑺傜偣緇撴瀯
5
template<class T>
6
class Node
7

{
8
public:
9
Node(const T & val)
{data=val;next=NULL;}
10
T data;
11
Node<T> *next;
12
};
13
14
//鏍堝疄鐜?/span>
15
template<class T>
16
class Stack
17

{
18
public:
19
Stack();
20
virtual ~Stack();
21
bool IsEmpty();
22
Stack<T>& Push(const T &val);
23
Stack<T>& Pop(T &e);
24
T& GetTop() const
{return Top->data;};
25
int Size() const
{return _Size;};
26
27
private:
28
int _Size;
29
Node<T> *Top;
30
31
};
32
//-----------------------------------------------------------
33
template<class T>
34
Stack<T>::Stack()
35

{
36
Top=NULL;
37
_Size=0;
38
}
39
40
//-----------------------------------------------------------
41
template<class T>
42
bool Stack<T>::IsEmpty()
43

{ return !Top?true:false;
44
45
}
46
//-----------------------------------------------------------
47
template<class T>
48
Stack<T>::~Stack()
49

{
50
Node<T>* move=NULL;
51
while(Top)
52
{
53
move=Top->next;
54
delete Top;
55
Top=move;
56
}
57
58
}
59
//-----------------------------------------------------------
60
template<class T>
61
Stack<T>& Stack<T>::Push(const T &val)
62

{
63
64
Node<T> *NewNode = new Node<T>(val);
65
NewNode->next=Top;
66
Top=NewNode;
67
++_Size;
68
return *this;
69
}
70
//-----------------------------------------------------------
71
template<class T>
72
Stack<T>& Stack<T>::Pop(T &e)
73

{
74
if(Top==NULL) throw exception("鏍堜笅婧?/span>");
75
e=Top->data;
76
Node<T> *p=Top;
77
Top=Top->next;
78
delete p;
79
--_Size;
80
return *this;
81
}
82
83
84
#endif

]]> - 鏍堢粨鏋勭畝鍗曞疄鐜幫紙鍩轟簬鏁扮粍錛?/title>http://www.shnenglu.com/xingkongyun/articles/62297.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Fri, 19 Sep 2008 10:43:00 GMThttp://www.shnenglu.com/xingkongyun/articles/62297.htmlhttp://www.shnenglu.com/xingkongyun/comments/62297.htmlhttp://www.shnenglu.com/xingkongyun/articles/62297.html#Feedback0http://www.shnenglu.com/xingkongyun/comments/commentRss/62297.htmlhttp://www.shnenglu.com/xingkongyun/services/trackbacks/62297.html 1
//鏁版嵁緇撴瀯鍫嗘爤瀹炵幇錛堝熀浜庢暟緇勶級(jí)
2
#ifndef STACK_H
3
#define STACK_H
4
template<class T>
5
class Stack
6

{
7
public:
8
Stack(int maxsize=50);
9
virtual ~Stack();
10
bool IsEmpty();
11
Stack<T>& Push(const T &val);
12
Stack<T>& Pop(T &e);
13
T& GetTop() const
{return Data[Top];};
14
int Size() const
{return Top+1;};
15
16
private:
17
T *Data;
18
int MaxSize;
19
int Top;
20
21
};
22
23
24
//-----------------------------------------------------------
25
template<class T>
26
Stack<T>::Stack(int maxsize)
27

{
28
MaxSize=maxsize;
29
Data=new T[MaxSize];
30
Top=-1;
31
}
32
33
//-----------------------------------------------------------
34
template<class T>
35
bool Stack<T>::IsEmpty()
36

{ return Top==-1?true:false;
37
38
}
39
//-----------------------------------------------------------
40
template<class T>
41
Stack<T>::~Stack()
42

{
43
delete[] Data;
44
}
45
//-----------------------------------------------------------
46
template<class T>
47
Stack<T>& Stack<T>::Push(const T &val)
48

{
49
if(Top==MaxSize-1) throw exception("鏍堜笂婧?/span>");
50
Data[++Top]=val;
51
return *this;
52
}
53
//-----------------------------------------------------------
54
template<class T>
55
Stack<T>& Stack<T>::Pop(T &e)
56

{
57
if(Top==-1) throw exception("鏍堜笅婧?/span>");
58
e=Data[Top--];
59
return *this;
60
}
61
#endif

]]> - 鍗曞悜甯﹀ご緇撶偣寰幆閾捐〃瀹炵幇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)锛?jí)鐨勭浉鍏寵祫鏂?/title>http://www.shnenglu.com/xingkongyun/articles/62192.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Thu, 18 Sep 2008 09:20:00 GMThttp://www.shnenglu.com/xingkongyun/articles/62192.htmlhttp://www.shnenglu.com/xingkongyun/comments/62192.htmlhttp://www.shnenglu.com/xingkongyun/articles/62192.html#Feedback0http://www.shnenglu.com/xingkongyun/comments/commentRss/62192.htmlhttp://www.shnenglu.com/xingkongyun/services/trackbacks/62192.html鍏充簬綰㈤粦鏍?wèi)锛坮-b鏍?wèi)锛?jí)鐨勭浉鍏寵祫鏂?/a>

]]>- 浜屽弶鎼滅儲(chǔ)鏍?wèi)瀹炵?/title>http://www.shnenglu.com/xingkongyun/articles/62190.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Thu, 18 Sep 2008 09:17:00 GMThttp://www.shnenglu.com/xingkongyun/articles/62190.htmlhttp://www.shnenglu.com/xingkongyun/comments/62190.htmlhttp://www.shnenglu.com/xingkongyun/articles/62190.html#Feedback0http://www.shnenglu.com/xingkongyun/comments/commentRss/62190.htmlhttp://www.shnenglu.com/xingkongyun/services/trackbacks/62190.html
1
#include "BinTree.h"
2
3
template<class K,class E>
4
class BinSearchTree:public BinTree<E>
5

{
6
public:
7
bool Search(const K &k,E &e);//浠ュ叧閿瓧K榪涜鎼滅儲(chǔ)錛岀粨鏋滆繑鍥炲埌e涓?/span>
8
BinSearchTree<K,E>& Insert(const E &e);//灝嗗厓绱爀鎻掑叆鍒版爲(wèi)涓?/span>
9
BinSearchTree<K,E>& Delete(const K &k,E &e);//閫氳繃鎸囧畾鍏抽敭瀛梜榪涜鑺傜偣鐨勫垹闄?/span>
10
11
};
12
13
//----------------------------------------------------------
14
template<class K,class E>
15
bool BinSearchTree<K,E>::Search(const K &k,E &e)
16

{
17
18
BinTreeNode<E> *p=root;
19
while(p)
20

{
21
if(k<p->data)
22
p=p->LeftChild;
23
else if(k>p->data)
24
p=p->RightChild;
25
else//鎵懼埌鍏冪礌
26

{
27
e=p->data;
28
return true;
29
}
30
}
31
return false;
32
}
33
//----------------------------------------------------------
34
template<class K,class E>
35
BinSearchTree<K,E>& BinSearchTree<K,E>::Insert(const E &e)
36

{
37
38
BinTreeNode<E> *p=root,*pp=NULL;
39
while(p)
40

{
41
pp=p;
42
if(e<=p->data)
43
p=p->LeftChild;
44
else
45
p=p->RightChild;
46
}
47
48
BinTreeNode<E> *NewNode=new BinTreeNode<E>(e);
49
if(root)
50

{
51
if(e<=pp->data)
52
pp->LeftChild=NewNode;
53
else
54
pp->RightChild=NewNode;
55
}
56
else
57
root=NewNode;
58
return *this;
59
}
60
61
//----------------------------------------------------------
62
template<class K,class E>
63
BinSearchTree<K,E>& BinSearchTree<K,E>::Delete(const K &k,E &e)
64

{
65
BinTreeNode<E> *p=root,*pp=NULL;
66
67
while(p&&p->data!=k)
68

{pp=p;
69
if(k<p->data) p=p->LeftChild;
70
else p=p->RightChild;
71
}
72
73
if(!p)
{throw exception("娌℃湁鎵懼埌鎸囧畾鍏冪礌");}
74
e=p->data;
75
if(p->LeftChild&&p->RightChild)//p鐨勫乏鍙沖瀛愬潎涓嶄負(fù)絀?/span>
76

{
77
BinTreeNode<E> *s=p->LeftChild,*ps=p;
78
while(s->RightChild)
79

{
80
ps=s;
81
s=s->RightChild;
82
}
83
84
p->data=s->data;
85
p=s;
86
pp=ps;
87
}//if
88
BinTreeNode<E> *c;
89
if(p->LeftChild) c=p->LeftChild;
90
else c=p->RightChild;
91
92
if(p==root) root=c;
93
else
94

{
95
96
if(p==pp->LeftChild) pp->LeftChild=c;
97
else pp->RightChild=c;
98
}
99
delete p;
100
101
return *this;
102
}

]]> - 浜屽弶鏍?wèi)瀹炵?/title>http://www.shnenglu.com/xingkongyun/articles/62187.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Thu, 18 Sep 2008 09:14:00 GMThttp://www.shnenglu.com/xingkongyun/articles/62187.htmlhttp://www.shnenglu.com/xingkongyun/comments/62187.htmlhttp://www.shnenglu.com/xingkongyun/articles/62187.html#Feedback0http://www.shnenglu.com/xingkongyun/comments/commentRss/62187.htmlhttp://www.shnenglu.com/xingkongyun/services/trackbacks/62187.html闃呰鍏ㄦ枃

]]> - 鏈澶ч珮搴︿紭鍏堝乏楂樻爲(wèi)錛圚BLT錛夊疄鐜?/title>http://www.shnenglu.com/xingkongyun/articles/62107.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Wed, 17 Sep 2008 13:32:00 GMThttp://www.shnenglu.com/xingkongyun/articles/62107.htmlhttp://www.shnenglu.com/xingkongyun/comments/62107.htmlhttp://www.shnenglu.com/xingkongyun/articles/62107.html#Feedback0http://www.shnenglu.com/xingkongyun/comments/commentRss/62107.htmlhttp://www.shnenglu.com/xingkongyun/services/trackbacks/62107.html闃呰鍏ㄦ枃

]]> - 鏈澶у爢瀹炵幇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闃呰鍏ㄦ枃

]]>
久久精品免费观看|
亚洲综合精品香蕉久久网97|
segui久久国产精品|
久久男人中文字幕资源站|
国内精品久久久久影院老司
|
久久香蕉国产线看观看精品yw|
精品国产一区二区三区久久|
久久国产成人精品国产成人亚洲|
久久综合色老色|
91久久香蕉国产熟女线看|
狠狠色丁香婷婷久久综合
|
久久亚洲欧美国产精品|
91久久精品电影|
久久婷婷色香五月综合激情|
日韩一区二区久久久久久|
99久久国语露脸精品国产|
精品久久久久久中文字幕大豆网|
91精品国产高清久久久久久国产嫩草|
亚洲国产成人久久综合碰碰动漫3d|
久久综合久久美利坚合众国|
国产精品亚洲综合专区片高清久久久
|
色88久久久久高潮综合影院|
久久精品三级视频|
久久er国产精品免费观看8|
久久精品国产99久久无毒不卡|
亚洲精品乱码久久久久66|
中文字幕亚洲综合久久菠萝蜜|
韩国三级中文字幕hd久久精品|
婷婷久久久亚洲欧洲日产国码AV
|
国产精品久久久久乳精品爆
|
狠狠色伊人久久精品综合网|
精品无码久久久久国产|
99久久成人国产精品免费|
久久无码人妻一区二区三区|
AV无码久久久久不卡蜜桃|
亚洲精品乱码久久久久久按摩|
四虎影视久久久免费观看|
久久久亚洲AV波多野结衣|
尹人香蕉久久99天天拍|
一本久久综合亚洲鲁鲁五月天亚洲欧美一区二区
|
超级碰碰碰碰97久久久久|