-
Notifications
You must be signed in to change notification settings - Fork 23
Homework #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Homework #27
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
|
||
#include <stdexcept> | ||
|
||
#include "graph/vertex.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'graph/vertex.hpp' file not found [clang-diagnostic-error]
#include "graph/vertex.hpp"
^
@@ -0,0 +1,232 @@ | |||
#include <gtest/gtest.h> | |||
|
|||
#include "graph/weighted_graph.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'graph/weighted_graph.hpp' file not found [clang-diagnostic-error]
#include "graph/weighted_graph.hpp"
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
|
||
#include <stdexcept> | ||
|
||
#include "graph/vertex.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'graph/vertex.hpp' file not found [clang-diagnostic-error]
#include "graph/vertex.hpp"
^
@@ -0,0 +1,232 @@ | |||
#include <gtest/gtest.h> | |||
|
|||
#include "graph/weighted_graph.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'graph/weighted_graph.hpp' file not found [clang-diagnostic-error]
#include "graph/weighted_graph.hpp"
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
visited[v] = true; | ||
if (p) d[v] = h[v] = h[p] + 1; | ||
|
||
int children_count = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'children_count' of type 'int' can be declared 'const' [misc-const-correctness]
int children_count = 0; | |
int const children_count = 0; |
: graph(is_oriented) { | ||
if (edges.size() != weights.size()) | ||
throw std::invalid_argument( | ||
"The number of weighted edges is greater than the number of all " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ну не совсем greater скорее not equal) не сниму за это)
void DFS(Graph<T>& graph, std::unordered_map<T, bool>& visited, | ||
std::vector<T>& res, const T& curr_vertex) { | ||
if (visited[curr_vertex]) | ||
throw std::invalid_argument("Graph is not acyclic!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лучше кажется написать что то типа Graph has a cycle, не буду это учитывать
Задания от Акрамова Никиты, группа Б03-314