-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVertex.cpp
More file actions
51 lines (40 loc) · 782 Bytes
/
Vertex.cpp
File metadata and controls
51 lines (40 loc) · 782 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
//
// Created by Sparsh on 4/10/2021.
//
#include "Vertex.h"
#include <iostream>
Vertex::Vertex(Vertex * parent, int index) {
this->parent = parent;
this->index = index;
this->degree = 0;
}
Vertex::Vertex() {
this->parent = nullptr;
}
int Vertex::getIndex() {
return index;
}
void Vertex::addDegree() {
this->degree = degree + 1;
}
void Vertex::removeDegree() {
this->degree = degree-1;
}
int Vertex::getDegree() {
return degree;
}
void Vertex::setKey(double key) {
this->key = key;
}
void Vertex::setParent(Vertex *parent) {
this->parent = parent;
}
double Vertex::getKey() {
return key;
}
void Vertex::setTempWeight(double temp) {
this->tempWeight = temp;
}
double Vertex::getTempWeight() {
return this->tempWeight;
}