-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
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.
Great work! 😄👍
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.
LGTM 🚀 Thank you for your contribution! 😄👍
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.
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
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.
LGTM 🚀 Please review again, @ayaankhan98.
Description of Change
I have implemented a recursive solution to check whether the given graph is bipartite or not.
Checklist
Notes: