-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraph.h
More file actions
54 lines (48 loc) · 1022 Bytes
/
Copy pathgraph.h
File metadata and controls
54 lines (48 loc) · 1022 Bytes
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
49
50
51
52
53
54
#ifndef GRAPH_H_INCLUDED
#define GRAPH_H_INCLUDED
using namespace std;
class GrA
{
protected:
int n,m;
public:
GrA():n(0), m(0) {};
virtual bool in(string FN)=0;
virtual void out(string FN)=0;
virtual bool oneArc(int* ans)=0;
};
class GrM: public GrA
{
protected:
int* E [10000];
bool init();
public:
GrM(): E({nullptr}) {for(int i=0; i<10000; ++i) E[i]=nullptr;};
~GrM();
bool in(string FN);
void out(string FN);
bool oneArc(int* ans);
//op =
};
class GrSL: public GrA
{
protected:
int** E;
bool init();
public:
GrSL():E(nullptr) {};
~GrSL();
bool in(string FN);
void out(string FN);
bool oneArc(int* ans);
void transp(GrSL& a);
void ch();
// op =
};
struct ListV
{
int nV;
int* l;
};
void ansOut1(ListV a, string FN);
#endif // GRAPH_H_INCLUDED