-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgraphNode.cpp
More file actions
55 lines (36 loc) · 835 Bytes
/
Copy pathgraphNode.cpp
File metadata and controls
55 lines (36 loc) · 835 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
55
/*
* GraphNode.cpp
* topicNet
*
* Created by basak alper on 5/28/10.
* Copyright 2010 ucsb. All rights reserved.
*
*/
#include "graphNode.h"
GraphNode :: GraphNode()
:label("empty"), level(1), nodeid(""), intid(0)
{
}
GraphNode :: GraphNode(int indid, string idd, string lab)
:label(lab), level(1), nodeid(idd), intid(indid)
{
}
GraphNode :: ~GraphNode()
{
//delete dynamic arrays
}
void GraphNode :: printname(){
printf("node id and name $i \n", nodeid);
}
void GraphNode :: addAdjacentNode(GraphNode * n){
adjacents.push_back(n);
}
void GraphNode :: addAdjacentEdge(GraphEdge * e){
adjedges.push_back(e);
}
void GraphNode :: printAdjacentNodes(){
for (int a =0; a< adjacents.size(); a++){
GraphNode * tmp = adjacents.at(a);
printf("neighbors %i 'th id is: %i \n", a, tmp->getNodeid());
}
}