Skip to content

#4358 Fix : Floodfill infinite recursion due to same color - #4359

Merged
vil02 merged 1 commit into
TheAlgorithms:masterfrom
Manan-09:#4358
Sep 9, 2023
Merged

#4358 Fix : Floodfill infinite recursion due to same color#4359
vil02 merged 1 commit into
TheAlgorithms:masterfrom
Manan-09:#4358

Conversation

@Manan-09

@Manan-09 Manan-09 commented Sep 9, 2023

Copy link
Copy Markdown
Contributor
  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.

Fixed #4358
Fixed case when both newColor and oldColor is passed as same integer causing infinite recursion by adding extra base condition.
Also added testcase for same and after that ran all testcase, which resulted as all passed.

Screenshot 2023-09-09 at 6 04 36 PM

@Manan-09 Manan-09 changed the title Fix : Floodfill infinite recursion due to same color #4358 Fix : Floodfill infinite recursion due to same color Sep 9, 2023
@Manan-09
Manan-09 force-pushed the #4358 branch 2 times, most recently from dd33754 to 0af9c13 Compare September 9, 2023 12:44
@Manan-09 Manan-09 changed the title #4358 Fix : Floodfill infinite recursion due to same color 4358 Fix : Floodfill infinite recursion due to same color Sep 9, 2023
@Manan-09 Manan-09 changed the title 4358 Fix : Floodfill infinite recursion due to same color #4358 Fix : Floodfill infinite recursion due to same color Sep 9, 2023

@vil02 vil02 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good.

There are few changes changes in the remaining pieces of this file, but I cannot suggest them here. I will make a suitable PR afterward.

@vil02
vil02 merged commit a88abb7 into TheAlgorithms:master Sep 9, 2023
@vil02 vil02 mentioned this pull request Sep 9, 2023
5 tasks
@Manan-09

Manan-09 commented Sep 9, 2023

Copy link
Copy Markdown
Contributor Author

Thanks @vil02 ,
This was my first open source contribution 😃

@vil02

vil02 commented Sep 9, 2023

Copy link
Copy Markdown
Member

@Manan-09 this was my first merge as a maintainer of this repository! Enjoy further contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Backtracking > Floodfill : Code goes in infinite calling loop when same color is passed in newColor and oldColor

2 participants