Skip to content
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

feat: a different implementation of checking bipartite-ness of a graph #1769

Merged
merged 20 commits into from
Oct 28, 2021

Conversation

tushar2407
Copy link
Contributor

@tushar2407 tushar2407 commented Oct 19, 2021

Description of Change

I have implemented a recursive solution to check whether the given graph is bipartite or not.

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:

Panquesito7
Panquesito7 previously approved these changes Oct 20, 2021
Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! 😄👍

graph/is_graph_bipartite2.cpp Outdated Show resolved Hide resolved
graph/is_graph_bipartite2.cpp Show resolved Hide resolved
graph/is_graph_bipartite2.cpp Show resolved Hide resolved
graph/is_graph_bipartite2.cpp Outdated Show resolved Hide resolved
graph/is_graph_bipartite2.cpp Outdated Show resolved Hide resolved
@Panquesito7 Panquesito7 added enhancement New feature or request requested changes changes required labels Oct 20, 2021
Panquesito7
Panquesito7 previously approved these changes Oct 26, 2021
Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀 Thank you for your contribution! 😄👍

@Panquesito7 Panquesito7 added approved Approved; waiting for merge and removed requested changes changes required labels Oct 26, 2021
Copy link
Member

@ayaankhan98 ayaankhan98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test.cpp: In function ‘bool graph::checkBipartite(std::vector<std::vector<long int> >, int64_t, std::vector<long int>)’:
test.cpp:42:22: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<long int>::size_type’ {aka ‘long unsigned int’} [-Werror=sign-compare]
   42 |         for(int i=0;i<graph[u].size();i++)
      |                     ~^~~~~~~~~~~~~~~~
test.cpp: In function ‘bool graph::isBipartite(std::vector<std::vector<long int> >)’:
test.cpp:67:18: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::vector<long int> >::size_type’ {aka ‘long unsigned int’} [-Werror=sign-compare]
   67 |     for(int i=0;i<graph.size();i++)
      |                 ~^~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

shell returned 1

Panquesito7
Panquesito7 previously approved these changes Oct 26, 2021
Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀 Please review again, @ayaankhan98.

@Panquesito7 Panquesito7 merged commit a9312b3 into TheAlgorithms:master Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved; waiting for merge enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants