Conversation
|
Hi, thank you for your interest in the Algorithm Archive! However, the first step of admissibility is not yet reached: you need to get your code to compile on a Docker Ubuntu-based environment, which, as I am writing this, just failed. Please fix it, so we can review and eventually merge your code in. |
|
Hi, |
|
Thank you for the reactivity (relative to timezones, of course)! |
Amaras
left a comment
There was a problem hiding this comment.
I checked your code before going to sleep, and it was empty.
Apparently your last commit truncated your flood_fill.java file, and outright deleted your Main.java file.
Please fix that, so we can review your code
|
Hi, |
Amaras
left a comment
There was a problem hiding this comment.
Okay, so while I'm not a Java specialist, the code was clear enough for me to approve it. I would ask for a second opinion, but I don't know anyone who is comfortable enough reviewing Java code :/
The only thing that annoys me is your package thing, but apart from that, I have nothing to say about the code.
| if (p.x < 0 || p.x >= row || p.y < 0 || p.y >= col) return false; | ||
| return true; |
There was a problem hiding this comment.
maybe you can just do:
| if (p.x < 0 || p.x >= row || p.y < 0 || p.y >= col) return false; | |
| return true; | |
| return (p.x < 0 || p.x >= row || p.y < 0 || p.y >= col); |
There was a problem hiding this comment.
sorry, wrong call: it was missing a ! operator before the parenthesis...
Co-authored-by: Sammy Plat <sammy@sammyplat.fr>
Amaras
left a comment
There was a problem hiding this comment.
So, since you didn't respond to my last few comments, here is a new review.
Since you removed one line when removing the if statement in inbound(), you'll need to adjust the line numbers as well.
Looking forward to your next commit.
| } | ||
| public static boolean inbound(int[][] grid, Point p){ | ||
| int row = grid.length, col = grid[0].length; | ||
| return (p.x < 0 || p.x >= row || p.y < 0 || p.y >= col); |
There was a problem hiding this comment.
Sorry I mislead you earlier, this should be the correct way:
| return (p.x < 0 || p.x >= row || p.y < 0 || p.y >= col); | |
| return !(p.x < 0 || p.x >= row || p.y < 0 || p.y >= col); |
add java code for implementation of flood fill