Skip to content

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

Open
wants to merge 36 commits into
base: main
Choose a base branch
from

Conversation

LightAboveFighter
Copy link
Contributor

Global readme with nstructions

Copy link

@github-actions github-actions bot left a 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>

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) {

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) {

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) {

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) {

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) {

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],

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;

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]

Suggested change
int t = v;
int const t = v;

v = u;
u = t;
}
int height = sparse_table[0].size();

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();

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]

Suggested change
int height = sparse_table[0].size();
int const height = sparse_table[0].size();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant