Skip to content

Commit 3bf2999

Browse files
authored
Update kruskals_minimum_spanning_tree.cpp
move infinity valued inside test
1 parent 9620859 commit 3bf2999

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

greedy_algorithms/kruskals_minimum_spanning_tree.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,22 @@ void findMinimumEdge(const T &infinity,
5757
}
5858
} // namespace greedy_algorithms
5959

60-
/**
61-
* define a large constant value for int
62-
* define a large constant value for float
63-
* define a large constant value for double
64-
* define infinity for uint32_t
65-
*/
66-
constexpr int INFINITY_INT = std::numeric_limits<int>::max();
67-
constexpr float INFINITY_FLOAT = std::numeric_limits<float>::max();
68-
constexpr double INFINITY_DOUBLE = std::numeric_limits<double>::max();
69-
constexpr uint32_t INFINITY_UINT32 = UINT32_MAX;
70-
7160
/**
7261
* @brief Self-test implementations
7362
* @returns void
7463
*/
7564
static void test() {
65+
/**
66+
* define a large value for int
67+
* define a large value for float
68+
* define a large value for double
69+
* define a large value for uint32_t
70+
*/
71+
constexpr int INFINITY_INT = std::numeric_limits<int>::max();
72+
constexpr float INFINITY_FLOAT = std::numeric_limits<float>::max();
73+
constexpr double INFINITY_DOUBLE = std::numeric_limits<double>::max();
74+
constexpr uint32_t INFINITY_UINT32 = UINT32_MAX;
75+
7676
// Test case with integer values
7777
std::cout << "\nTest Case 1 :\n";
7878
std::array<std::array<int, 6>, 6> graph1{

0 commit comments

Comments
 (0)