Kirill Yartsev - #26
Conversation
| @@ -1,8 +1,84 @@ | |||
|
|
|||
| #include <gtest/gtest.h> | |||
There was a problem hiding this comment.
warning: 'gtest/gtest.h' file not found [clang-diagnostic-error]
#include <gtest/gtest.h>
^|
|
||
| TEST(TopologySort, Simple) { | ||
| ASSERT_EQ(1, 1); // Stack [] | ||
| int vertices = 4; |
There was a problem hiding this comment.
warning: variable 'vertices' of type 'int' can be declared 'const' [misc-const-correctness]
| int vertices = 4; | |
| int const vertices = 4; |
| } | ||
|
|
||
| TEST(TopologySort, SimpleCycle) { | ||
| int vertices = 4; |
There was a problem hiding this comment.
warning: variable 'vertices' of type 'int' can be declared 'const' [misc-const-correctness]
| int vertices = 4; | |
| int const vertices = 4; |
| } | ||
|
|
||
| TEST(TopologySort, Medium) { | ||
| int vertices = 6; |
There was a problem hiding this comment.
warning: variable 'vertices' of type 'int' can be declared 'const' [misc-const-correctness]
| int vertices = 6; | |
| int const vertices = 6; |
| } | ||
|
|
||
| TEST(TopologySort, Hard) { | ||
| int vertices = 9; |
There was a problem hiding this comment.
warning: variable 'vertices' of type 'int' can be declared 'const' [misc-const-correctness]
| int vertices = 9; | |
| int const vertices = 9; |
|
|
||
| for (int u = 0; u < weight_adjacency_list_.size(); ++u) | ||
| for (const auto& edge : weight_adjacency_list_[u]) { | ||
| int v = edge.first; |
There was a problem hiding this comment.
warning: variable 'v' of type 'int' can be declared 'const' [misc-const-correctness]
| int v = edge.first; | |
| int const v = edge.first; |
| for (int u = 0; u < weight_adjacency_list_.size(); ++u) | ||
| for (const auto& edge : weight_adjacency_list_[u]) { | ||
| int v = edge.first; | ||
| int weight = edge.second; |
There was a problem hiding this comment.
warning: variable 'weight' of type 'int' can be declared 'const' [misc-const-correctness]
| int weight = edge.second; | |
| int const weight = edge.second; |
| pq.push({0, source}); | ||
|
|
||
| while (!pq.empty()) { | ||
| int u = pq.top().second; |
There was a problem hiding this comment.
warning: variable 'u' of type 'int' can be declared 'const' [misc-const-correctness]
| int u = pq.top().second; | |
| int const u = pq.top().second; |
| pq.pop(); | ||
|
|
||
| for (const auto& edge : weight_adjacency_list_[u]) { | ||
| int v = edge.first; |
There was a problem hiding this comment.
warning: variable 'v' of type 'int' can be declared 'const' [misc-const-correctness]
| int v = edge.first; | |
| int const v = edge.first; |
|
|
||
| for (const auto& edge : weight_adjacency_list_[u]) { | ||
| int v = edge.first; | ||
| int weight = edge.second; |
There was a problem hiding this comment.
warning: variable 'weight' of type 'int' can be declared 'const' [misc-const-correctness]
| int weight = edge.second; | |
| int const weight = edge.second; |
No description provided.