锘??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
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
//鏁版嵁緇撴瀯鍫嗘爤瀹炵幇錛堝熀浜庢暟緇勶級
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)锛夌殑鐩稿厡櫟勬?/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)锛夌殑鐩稿厡櫟勬?/a>

]]>- 浜屽弶鎼滅儲鏍?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榪涜鎼滅儲錛岀粨鏋滆繑鍥炲埌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闃呰鍏ㄦ枃

]]>
亚洲国产另类久久久精品黑人|
免费观看久久精彩视频|
久久这里都是精品|
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|