homework - #11
Conversation
| int V; | ||
| list<int>* adj; | ||
|
|
||
| void SCCUtil(int u, int disc[], int low[], |
There was a problem hiding this comment.
warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays]
void SCCUtil(int u, int disc[], int low[],
^| int V; | ||
| list<int>* adj; | ||
|
|
||
| void SCCUtil(int u, int disc[], int low[], |
There was a problem hiding this comment.
warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays]
void SCCUtil(int u, int disc[], int low[],
^| list<int>* adj; | ||
|
|
||
| void SCCUtil(int u, int disc[], int low[], | ||
| stack<int>* st, bool stackMember[]); |
There was a problem hiding this comment.
warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays]
stack<int>* st, bool stackMember[]);
^|
|
||
| Graph::Graph(int V) | ||
| { | ||
| this->V = V; |
There was a problem hiding this comment.
warning: 'V' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
additional_tasks/Author's tasks/Task A/src/solution.cpp:18:
- Graph::Graph(int V)
+ Graph::Graph(int V) : V(V)| this->V = V; | |
| Graph::Graph(int V) | ||
| { | ||
| this->V = V; | ||
| adj = new list<int>[V]; |
There was a problem hiding this comment.
warning: 'adj' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
additional_tasks/Author's tasks/Task A/src/solution.cpp:18:
- Graph::Graph(int V)
+ Graph::Graph(int V), adj(new list<int>[V])| adj = new list<int>[V]; | |
|
|
||
| template <template <class> class T> | ||
| vector<int> Dijkstra(EDGES_LISTS &edges_lists, int start_vertex) { | ||
| int n = edges_lists.size(); |
There was a problem hiding this comment.
warning: variable 'n' of type 'int' can be declared 'const' [misc-const-correctness]
| int n = edges_lists.size(); | |
| int const n = edges_lists.size(); |
|
|
||
| template <template <class> class T> | ||
| vector<int> Dijkstra(EDGES_LISTS &edges_lists, int start_vertex) { | ||
| int n = edges_lists.size(); |
There was a problem hiding this comment.
warning: narrowing conversion from 'size_type' (aka 'unsigned long') to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions]
int n = edges_lists.size();
^| heap.Insert({0, start_vertex}); | ||
|
|
||
| while (!heap.IsEmpty()) { | ||
| int v = heap.GetMinimum().second; |
There was a problem hiding this comment.
warning: variable 'v' of type 'int' can be declared 'const' [misc-const-correctness]
| int v = heap.GetMinimum().second; | |
| int const v = heap.GetMinimum().second; |
| } | ||
| used[v] = true; | ||
| for (auto i : edges_lists[v]) { | ||
| int u = i.first, d = i.second; |
There was a problem hiding this comment.
warning: variable 'u' of type 'int' can be declared 'const' [misc-const-correctness]
int u = i.first, d = i.second;
^| used[v] = true; | ||
| for (auto i : edges_lists[v]) { | ||
| int u = i.first, d = i.second; | ||
| int new_dist = distance[v] + d; |
There was a problem hiding this comment.
warning: variable 'new_dist' of type 'int' can be declared 'const' [misc-const-correctness]
| int new_dist = distance[v] + d; | |
| int const new_dist = distance[v] + d; |
No description provided.