forked from harsimrans/algorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph1.cpp
60 lines (50 loc) · 832 Bytes
/
graph1.cpp
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
55
56
57
58
59
60
#include<iostream>
#include<string>
using namespace std;
class Node{
private:
string name;
int id;
public:
// Node(int id, string name)
// {
// setId(id);
// setName(name);
// }
void setId(int Id)
{
id = Id;
}
int getId()
{
return id;
}
string getName()
{
return name;
}
void setName(string nodeName)
{
name = nodeName;
}
};
class Edge{
private:
Node src, dest;
public:
Edge(Node &source, Node &destination)
{
src = source;
dest = destination;
}
};
int main()
{
// Node foo(1, "hello");
// cout<<"the name is : "<<foo.getName()<<" and id : "<<foo.getId()<<endl;
//
// Node bar(2, "apple");
// cout<<"the name is : "<<bar.getName()<<endl;
//
return 0;
}