锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产午夜精品久久久久免费视,亚洲国产欧美国产综合久久,一本一道久久a久久精品综合http://m.shnenglu.com/xingkongyun/category/7344.html鏄熺┖闄ㄧ殑紼嬪簭灝忕珯zh-cnFri, 19 Sep 2008 22:02:14 GMTFri, 19 Sep 2008 22:02:14 GMT60- 寰幆闃熷垪瀹炵幇http://m.shnenglu.com/xingkongyun/articles/62301.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Fri, 19 Sep 2008 11:52:00 GMThttp://m.shnenglu.com/xingkongyun/articles/62301.htmlhttp://m.shnenglu.com/xingkongyun/comments/62301.htmlhttp://m.shnenglu.com/xingkongyun/articles/62301.html#Feedback0http://m.shnenglu.com/xingkongyun/comments/commentRss/62301.htmlhttp://m.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://m.shnenglu.com/xingkongyun/articles/62298.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Fri, 19 Sep 2008 11:09:00 GMThttp://m.shnenglu.com/xingkongyun/articles/62298.htmlhttp://m.shnenglu.com/xingkongyun/comments/62298.htmlhttp://m.shnenglu.com/xingkongyun/articles/62298.html#Feedback0http://m.shnenglu.com/xingkongyun/comments/commentRss/62298.htmlhttp://m.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://m.shnenglu.com/xingkongyun/articles/62297.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Fri, 19 Sep 2008 10:43:00 GMThttp://m.shnenglu.com/xingkongyun/articles/62297.htmlhttp://m.shnenglu.com/xingkongyun/comments/62297.htmlhttp://m.shnenglu.com/xingkongyun/articles/62297.html#Feedback0http://m.shnenglu.com/xingkongyun/comments/commentRss/62297.htmlhttp://m.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://m.shnenglu.com/xingkongyun/articles/62221.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Thu, 18 Sep 2008 12:54:00 GMThttp://m.shnenglu.com/xingkongyun/articles/62221.htmlhttp://m.shnenglu.com/xingkongyun/comments/62221.htmlhttp://m.shnenglu.com/xingkongyun/articles/62221.html#Feedback0http://m.shnenglu.com/xingkongyun/comments/commentRss/62221.htmlhttp://m.shnenglu.com/xingkongyun/services/trackbacks/62221.html闃呰鍏ㄦ枃

]]> - 鍏充簬綰㈤粦鏍?wèi)锛坮-b鏍?wèi)锛?jí)鐨勭浉鍏寵祫鏂?/title>http://m.shnenglu.com/xingkongyun/articles/62192.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Thu, 18 Sep 2008 09:20:00 GMThttp://m.shnenglu.com/xingkongyun/articles/62192.htmlhttp://m.shnenglu.com/xingkongyun/comments/62192.htmlhttp://m.shnenglu.com/xingkongyun/articles/62192.html#Feedback0http://m.shnenglu.com/xingkongyun/comments/commentRss/62192.htmlhttp://m.shnenglu.com/xingkongyun/services/trackbacks/62192.html鍏充簬綰㈤粦鏍?wèi)锛坮-b鏍?wèi)锛?jí)鐨勭浉鍏寵祫鏂?/a>

]]>- 浜屽弶鎼滅儲(chǔ)鏍?wèi)瀹炵?/title>http://m.shnenglu.com/xingkongyun/articles/62190.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Thu, 18 Sep 2008 09:17:00 GMThttp://m.shnenglu.com/xingkongyun/articles/62190.htmlhttp://m.shnenglu.com/xingkongyun/comments/62190.htmlhttp://m.shnenglu.com/xingkongyun/articles/62190.html#Feedback0http://m.shnenglu.com/xingkongyun/comments/commentRss/62190.htmlhttp://m.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://m.shnenglu.com/xingkongyun/articles/62187.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Thu, 18 Sep 2008 09:14:00 GMThttp://m.shnenglu.com/xingkongyun/articles/62187.htmlhttp://m.shnenglu.com/xingkongyun/comments/62187.htmlhttp://m.shnenglu.com/xingkongyun/articles/62187.html#Feedback0http://m.shnenglu.com/xingkongyun/comments/commentRss/62187.htmlhttp://m.shnenglu.com/xingkongyun/services/trackbacks/62187.html闃呰鍏ㄦ枃

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

]]> - 鏈澶у爢瀹炵幇http://m.shnenglu.com/xingkongyun/articles/62098.html鏉ㄥ漿褰?/dc:creator>鏉ㄥ漿褰?/author>Wed, 17 Sep 2008 11:49:00 GMThttp://m.shnenglu.com/xingkongyun/articles/62098.htmlhttp://m.shnenglu.com/xingkongyun/comments/62098.htmlhttp://m.shnenglu.com/xingkongyun/articles/62098.html#Feedback0http://m.shnenglu.com/xingkongyun/comments/commentRss/62098.htmlhttp://m.shnenglu.com/xingkongyun/services/trackbacks/62098.html闃呰鍏ㄦ枃

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

]]>
99蜜桃臀久久久欧美精品网站|
久久99精品国产自在现线小黄鸭|
久久777国产线看观看精品|
久久精品无码免费不卡|
无码人妻精品一区二区三区久久
|
久久超碰97人人做人人爱|
久久免费高清视频|
69久久夜色精品国产69|
伊人久久精品无码av一区|
av国内精品久久久久影院|
人妻系列无码专区久久五月天|
MM131亚洲国产美女久久|
久久青青草原精品国产软件|
国产福利电影一区二区三区久久久久成人精品综合|
久久人人爽人人爽人人片av麻烦|
99久久精品国产一区二区三区
|
精品国产乱码久久久久软件|
国产美女久久久|
久久精品卫校国产小美女|
国产午夜福利精品久久|
久久综合视频网|
欧美伊人久久大香线蕉综合|
亚洲人AV永久一区二区三区久久|
精品免费久久久久国产一区|
国内精品久久久久伊人av|
亚洲精品tv久久久久|
欧美午夜A∨大片久久
|
国产成人久久久精品二区三区|
中文字幕乱码久久午夜|
日日狠狠久久偷偷色综合免费|
国产A级毛片久久久精品毛片|
无码精品久久久天天影视|
久久99精品国产麻豆宅宅|
人妻无码精品久久亚瑟影视|
久久青青色综合|
久久精品国产免费观看
|
亚洲国产成人精品无码久久久久久综合
|
午夜精品久久久久久毛片|
久久久精品人妻一区二区三区蜜桃|
一个色综合久久|
久久这里都是精品|