-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlink.cpp
More file actions
48 lines (40 loc) · 1.2 KB
/
link.cpp
File metadata and controls
48 lines (40 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "link.h"
template <class Elem, class T>
Link<Elem, T> :: Link(const Elem & elemval, Link * nextval = NULL) {
element = elemval;
next = nextval;
bool tranfer = NULL; //初始化 不是换乘站
int transfer_num = 0; //初始化可换乘数量为0
}
template <class Elem, class T>
Link<Elem, T> :: Link(Link * nextval = NULL) {
next = nextval;
bool tranfer = NULL; //初始化 不是换乘站
int transfer_num = 0; //初始化可换乘数量为0
}
template <class Elem, class T>
void Link<Elem, T> :: SetLinkValue(T v, T n) {
LinkValue = v;
LinkValue2[0] = n;
}
template <class Elem, class T>
void Link<Elem, T> :: SetLinkValue(T v, T n, int i) { //重载
LinkValue = v;
LinkValue2[i+1] = n;
}
template <class Elem, class T>
int Link<Elem, T> :: transfer_Num() {
return transfer_num;
}
template <class Elem, class T>
bool Link<Elem, T> :: isTransfer() {
return tranfer;
}
template <class Elem, class T>
T Link<Elem, T> :: visit_Link_Value() {
return LinkValue;
}
template <class Elem, class T>
T Link<Elem, T> :: VisitValue() {
return LinkValue;
}