-
Notifications
You must be signed in to change notification settings - Fork 23
Readme #37
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?
Readme #37
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
#ifndef GRAPH_H_ | ||
#define GRAPH_H_ | ||
|
||
#include <iostream> |
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: 'iostream' file not found [clang-diagnostic-error]
#include <iostream>
^
|
||
try { | ||
topological_sort_dfs_non_rec(g); | ||
} catch (std::runtime_error) { |
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: catch handler catches by value; should catch by reference instead [misc-throw-by-value-catch-by-reference]
} catch (std::runtime_error) {
^
|
||
try { | ||
topological_sort_dfs_non_rec(g); | ||
} catch (std::runtime_error) { |
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: catch handler catches by value; should catch by reference instead [misc-throw-by-value-catch-by-reference]
} catch (std::runtime_error) {
^
|
||
try { | ||
topological_sort_dfs_rec(g); | ||
} catch (std::runtime_error) { |
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: catch handler catches by value; should catch by reference instead [misc-throw-by-value-catch-by-reference]
} catch (std::runtime_error) {
^
|
||
try { | ||
topological_sort_dfs_rec(g); | ||
} catch (std::runtime_error) { |
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: catch handler catches by value; should catch by reference instead [misc-throw-by-value-catch-by-reference]
} catch (std::runtime_error) {
^
auto start = data.end(); | ||
auto end = data.begin(); | ||
for (int i = 0; i < sparse_table.size(); ++i) { | ||
for (int j = data.size() - 1; j >= 0; --j) { |
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: narrowing conversion from 'size_type' (aka 'unsigned long') to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions]
for (int j = data.size() - 1; j >= 0; --j) {
^
} | ||
|
||
return std::min( | ||
sparse_table[smaller_log][first_ind + std::pow(2, smaller_log) - 1], |
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: narrowing conversion from 'typename __gnu_cxx::__promote_2<int, int>::__type' (aka 'double') to 'size_type' (aka 'unsigned long') [cppcoreguidelines-narrowing-conversions]
sparse_table[smaller_log][first_ind + std::pow(2, smaller_log) - 1],
^
|
||
int LCA::get_parent(int u, int v) { | ||
if (depth[u] < depth[v]) { | ||
int t = v; |
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 't' of type 'int' can be declared 'const' [misc-const-correctness]
int t = v; | |
int const t = v; |
v = u; | ||
u = t; | ||
} | ||
int height = sparse_table[0].size(); |
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: narrowing conversion from 'size_type' (aka 'unsigned long') to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions]
int height = sparse_table[0].size();
^
v = u; | ||
u = t; | ||
} | ||
int height = sparse_table[0].size(); |
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 'height' of type 'int' can be declared 'const' [misc-const-correctness]
int height = sparse_table[0].size(); | |
int const height = sparse_table[0].size(); |
Global readme with nstructions