Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Check too far generator voltage remote control #1119
base: main
Are you sure you want to change the base?
Check too far generator voltage remote control #1119
Changes from 22 commits
7dbba4b
18db0ad
04fd630
1b61b80
ecacea0
37bc4c6
3fede3d
936cc66
df97ff4
d4e082d
084eccb
0625c7d
73ff722
f1ea70b
60ad03a
8553815
e6ba659
cd3e1c0
f0a45dc
8247d88
fbbf0ed
1f1141d
bc4bb8c
68e2d10
6e566fd
9c8c5b2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This is an unusual way to implement a BFS. We can do it much simpler without these kind of set manipulation (busesToCheck.removeAll(checkedBuses)). Also we should take care for a BFS to have an orderer neighbors traversal (be careful with HashSets)
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.
Can you add a unit test for the method with various cases (exected distance, farther than maxDistance etc..)
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.
Reading again more conventional ways to implement breadth First Search (e.g. https://www.baeldung.com/java-breadth-first-search), I don't know (or I don't find) simpler ways to implement this. Here I chose this way of using sets for multiple reasons :
With this way of iteration (levels of distance) is it important to have an ordered neighbors traversal ?
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.
Ok