-
Notifications
You must be signed in to change notification settings - Fork 20k
Hamiltonian cycle implementation #3133
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
Hamiltonian cycle implementation #3133
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.
Please also format your code to use spaces instead of tabs and not to contain so many empty lines
src/main/java/com/thealgorithms/datastructures/graphs/HamiltonianCycle.java
Outdated
Show resolved
Hide resolved
- Rename solve method to isPathFound method which now returns true if path is found false otherwise, earlier the return type of this method was void - Improve flow by removing throw statement by using boolean return type - Replace all tab spaces with whitespaces
private HamiltonianCycle hamiltonianCycle = new HamiltonianCycle(); | ||
|
||
@Test | ||
void testFindHamiltonianCycleShouldReturnHamiltonianPath() { |
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.
If it's called findCycle
, it should return a cycle, not just a path. Please rename everything to find path
, not find cycle
if that's what it's supposed to do
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.
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.
Could you fix the build?
Closing this PR - due to some issue with this remote branch I am getting internal server when trying to push the changes. Link to issue raised in github community. Will create new branch and create a new PR with all the suggested changes. Thanks |
Describe your change:
References
#3057 Implementation of Hamiltonian Cycle
Checklist:
Fixes: #{$ISSUE_NO}
.