This repository was archived by the owner on May 27, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,5 +7,5 @@ if (CMAKE_BUILD_TYPE MATCHES RELEASE)
77 set (CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++" )
88endif (CMAKE_BUILD_TYPE MATCHES RELEASE )
99
10- set (SOURCE_FILES main.cpp Program.cpp Graph.cpp DirectedGraph.cpp UndirectedGraph.cpp)
10+ set (SOURCE_FILES main.cpp Program.cpp Graph.cpp DirectedGraph.cpp UndirectedGraph.cpp MinHeapElement.cpp )
1111add_executable (GraphRepresentationsAndAlgorithmsComparison ${SOURCE_FILES} )
Original file line number Diff line number Diff line change 1+ //
2+ // Created by barto on 20.05.18.
3+ //
4+
5+ #include " MinHeapElement.h"
6+
7+ // MinHeapElement
8+ // public
9+
10+ MinHeapElement::MinHeapElement (int edgeBeginning, int edgeEnd, int edgeValue) {
11+ this ->edgeBeginning = edgeBeginning;
12+ this ->edgeEnd = edgeEnd;
13+ this ->edgeValue = edgeValue;
14+ }
15+
16+ int MinHeapElement::getEdgeBeginning () const {
17+ return edgeBeginning;
18+ }
19+
20+ int MinHeapElement::getEdgeEnd () const {
21+ return edgeEnd;
22+ }
23+
24+ int MinHeapElement::getEdgeValue () const {
25+ return edgeValue;
26+ }
27+
28+ // MinHeapElementComparator
29+ // public
30+
31+ int MinHeapElementComparator::operator ()(const MinHeapElement &element1, const MinHeapElement &element2) {
32+ return element1.getEdgeValue () > element2.getEdgeValue ();
33+ }
Original file line number Diff line number Diff line change 1+ //
2+ // Created by barto on 20.05.18.
3+ //
4+
5+ #ifndef GRAPHREPRESENTATIONSANDALGORITHMSCOMPARISON_MINHEAPELEMENT_H
6+ #define GRAPHREPRESENTATIONSANDALGORITHMSCOMPARISON_MINHEAPELEMENT_H
7+
8+
9+ class MinHeapElement {
10+ public:
11+ MinHeapElement (int edgeBeginning, int edgeEnd, int edgeValue);
12+
13+ private:
14+ int edgeBeginning;
15+ int edgeEnd;
16+ int edgeValue;
17+
18+ public:
19+ int getEdgeBeginning () const ;
20+ int getEdgeEnd () const ;
21+ int getEdgeValue () const ;
22+
23+ };
24+
25+ class MinHeapElementComparator {
26+ public:
27+ int operator () (const MinHeapElement& element1, const MinHeapElement& element2);
28+
29+ };
30+
31+
32+ #endif // GRAPHREPRESENTATIONSANDALGORITHMSCOMPARISON_MINHEAPELEMENT_H
You can’t perform that action at this time.
0 commit comments