René's URL Explorer Experiment


Title: ### FIxes by krishnayak986-lang · Pull Request #7705 · TheAlgorithms/Java · GitHub

Open Graph Title: ### FIxes by krishnayak986-lang · Pull Request #7705 · TheAlgorithms/Java

X Title: ### FIxes by krishnayak986-lang · Pull Request #7705 · TheAlgorithms/Java

Description: [x ] I have read CONTRIBUTING.md. [ x] This pull request is all my own work -- I have not plagiarized it. [ x] All filenames are in PascalCase. [ x] All functions and variable names follow Java naming conventions. [ x] All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations. [ x] All new algorithms include a corresponding test class that validates their functionality. [ x] All new code is formatted with clang-format -i --style=file path/to/your/file.java Description This PR improves MazeRecursion so it no longer crashes on small mazes, supports custom start and target positions, validates its input, and no longer duplicates the solving logic. Problem solveMazeUsingFirstStrategy and solveMazeUsingSecondStrategy always read the hard-coded destination map[6][5], so any maze smaller than that (for example 2x2) threw an ArrayIndexOutOfBoundsException. The start (1,1) and destination (6,5) were hard-coded, so the solver couldn't be used with mazes of other sizes. setWay and setWay2 were nearly identical and differed only in direction order. Changes Added a bounds check before any cell is accessed, so the solver can no longer go out of bounds. Added overloads of both solve methods that accept startRow, startCol, targetRow, targetCol. The existing single-argument methods are kept and still use start (1,1) and target (6,5). Added input validation. An IllegalArgumentException is thrown for a null or empty maze, jagged rows, or a start/target position outside the maze. Replaced setWay and setWay2 with one shared recursive method that takes the direction order as a parameter. Preserved both traversal orders: First strategy: down -> right -> up -> left Second strategy: up -> right -> down -> left Paths are still marked 2 and dead ends 3. A maze with no route still returns null. Tests Added tests to MazeRecursionTest covering: A small maze solved with a custom start and target Both strategies keeping their traversal order A small maze with the default target throwing IllegalArgumentException instead of ArrayIndexOutOfBoundsException Null, empty and jagged mazes Out-of-bounds start and target An unsolvable maze returning null The existing tests for the default 8x7 maze are unchanged and still pass. Design note For invalid input (including a default target outside a small maze) I chose to throw IllegalArgumentException, while "no route found" keeps returning null as before. If maintainers prefer returning null for invalid input, that is a small change in validate, so let me know.

Open Graph Description: [x ] I have read CONTRIBUTING.md. [ x] This pull request is all my own work -- I have not plagiarized it. [ x] All filenames are in PascalCase. [ x] All functions and variable names follow Java nam...

X Description: [x ] I have read CONTRIBUTING.md. [ x] This pull request is all my own work -- I have not plagiarized it. [ x] All filenames are in PascalCase. [ x] All functions and variable names follow Java nam...

Opengraph URL: https://github.com/TheAlgorithms/Java/pull/7705

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:456ce93d-dff0-c325-3fa5-1b0ce4f598c7
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD512:1F5C:ECF3B:13E6AE:6B01E7E7
html-safe-nonceea89f8d3e3fbaf3ae9fa108bfb34df173221348eb7c2f6d2d7ad71a804cad6e2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTEyOjFGNUM6RUNGM0I6MTNFNkFFOjZCMDFFN0U3IiwidmlzaXRvcl9pZCI6IjQ5MjUxMzYyOTgzMDc2MTA1OTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac13fae1acb2e5951d93b8f63afca549c8e054e4f8ec491ff363d5097057d82d30
hovercard-subject-tagpull_request:5082880638
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/TheAlgorithms/Java/pull/7705/files
twitter:imagehttps://avatars.githubusercontent.com/u/246246015?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/246246015?s=400&v=4
og:image:alt[x ] I have read CONTRIBUTING.md. [ x] This pull request is all my own work -- I have not plagiarized it. [ x] All filenames are in PascalCase. [ x] All functions and variable names follow Java nam...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/TheAlgorithms/Java git https://github.com/TheAlgorithms/Java.git
octolytics-dimension-user_id20487725
octolytics-dimension-user_loginTheAlgorithms
octolytics-dimension-repository_id63477660
octolytics-dimension-repository_nwoTheAlgorithms/Java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id63477660
octolytics-dimension-repository_network_root_nwoTheAlgorithms/Java
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/TheAlgorithms/Java/pull/7705/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FTheAlgorithms%2FJava%2Fpull%2F7705%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FTheAlgorithms%2FJava%2Fpull%2F7705%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=TheAlgorithms%2FJava
Reloadhttps://github.com/TheAlgorithms/Java/pull/7705/files
Reloadhttps://github.com/TheAlgorithms/Java/pull/7705/files
Reloadhttps://github.com/TheAlgorithms/Java/pull/7705/files
TheAlgorithmshttps://github.com/TheAlgorithms
Javahttps://github.com/TheAlgorithms/Java
Codehttps://github.com/TheAlgorithms/Java
Issues5 (5)https://github.com/TheAlgorithms/Java/issues
Pull requests19 (19)https://github.com/TheAlgorithms/Java/pulls
Actionshttps://github.com/TheAlgorithms/Java/actions
Security and qualityhttps://github.com/TheAlgorithms/Java/security
Insightshttps://github.com/TheAlgorithms/Java/insights
Sign up for GitHub https://github.com/signup?return_to=%2FTheAlgorithms%2FJava%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FTheAlgorithms%2FJava%2Fissues%2Fnew%2Fchoose
krishnayak986-langhttps://github.com/krishnayak986-lang
TheAlgorithms:masterhttps://github.com/TheAlgorithms/Java/tree/master
krishnayak986-lang:fix/maze-recursion-bounds-and-validationhttps://github.com/krishnayak986-lang/Java/tree/fix/maze-recursion-bounds-and-validation
Conversation 2 https://github.com/TheAlgorithms/Java/pull/7705
Commits 11 https://github.com/TheAlgorithms/Java/pull/7705/commits
Checks 7 https://github.com/TheAlgorithms/Java/pull/7705/checks
Files changed https://github.com/TheAlgorithms/Java/pull/7705/files
Please reload this pagehttps://github.com/TheAlgorithms/Java/pull/7705/files
### FIxes https://github.com/TheAlgorithms/Java/pull/7705/files#top
Show all changes 11 commits https://github.com/TheAlgorithms/Java/pull/7705/files
df3b5d6 fix: handle bounds, validation and custom start/target in MazeRecursion krishnayak986-lang Oct 30, 2026 https://github.com/TheAlgorithms/Java/pull/7705/commits/df3b5d6d91210fef7d8bf6467045edff3dd51ad9
a90b3e5 Merge upstream master and resolve conflicts krishnayak986-lang Nov 12, 2026 https://github.com/TheAlgorithms/Java/pull/7705/commits/a90b3e5f4792a3300a3b301a856a1d0927585667
37b1071 style: apply clang-format krishnayak986-lang Nov 12, 2026 https://github.com/TheAlgorithms/Java/pull/7705/commits/37b10713441860ed14f7d48e6a20b17b0c15fb80
a6ede95 test: fix formatting and use fresh maze per strategy krishnayak986-lang Nov 12, 2026 https://github.com/TheAlgorithms/Java/pull/7705/commits/a6ede9587267ebe46d9d0e182912084a8d5494fc
471c5f6 test: expect null for default target outside small maze krishnayak986-lang Nov 12, 2026 https://github.com/TheAlgorithms/Java/pull/7705/commits/471c5f6f140e4d901a5773382acc042cb62501ce
625b89c style: remove trailing whitespace in MazeRecursion krishnayak986-lang Nov 12, 2026 https://github.com/TheAlgorithms/Java/pull/7705/commits/625b89ce3d4a36cb4a06ae83436749bbfa044587
e2484be style: remove trailing whitespace krishnayak986-lang Nov 12, 2026 https://github.com/TheAlgorithms/Java/pull/7705/commits/e2484be8a71b40bc1973d88262a3ddfdceeecfda
294da91 Merge branch 'master' into fix/maze-recursion-bounds-and-validation krishnayak986-lang Nov 14, 2026 https://github.com/TheAlgorithms/Java/pull/7705/commits/294da917c7edc5303c4bb18834a3f5f429294702
33839bb Merge branch 'master' into fix/maze-recursion-bounds-and-validation krishnayak986-lang Nov 17, 2026 https://github.com/TheAlgorithms/Java/pull/7705/commits/33839bbeec1f80d58ceac8f8d0d155f824e550d7
b09ebf1 Merge branch 'master' into fix/maze-recursion-bounds-and-validation krishnayak986-lang Nov 18, 2026 https://github.com/TheAlgorithms/Java/pull/7705/commits/b09ebf13341831313e1ccd0046142c768534df69
729f428 Merge branch 'master' into fix/maze-recursion-bounds-and-validation krishnayak986-lang Nov 21, 2026 https://github.com/TheAlgorithms/Java/pull/7705/commits/729f428540419f17f338e2956ef3e3d255b77c85
Clear filters https://github.com/TheAlgorithms/Java/pull/7705/files
Please reload this pagehttps://github.com/TheAlgorithms/Java/pull/7705/files
Please reload this pagehttps://github.com/TheAlgorithms/Java/pull/7705/files
MazeRecursion.java https://github.com/TheAlgorithms/Java/pull/7705/files#diff-b19b9543781bcac2d393bd02433cfbc2edd8cb95e79fff1f550e9e21455c32c3
MazeRecursionTest.java https://github.com/TheAlgorithms/Java/pull/7705/files#diff-11826e83d703952b45d747c1bf8f823016047330eba6d33d203ef74a464def64
https://github.com/TheAlgorithms/Java/blob/master/.github/CODEOWNERS#L1
src/main/java/com/thealgorithms/backtracking/MazeRecursion.javahttps://github.com/TheAlgorithms/Java/pull/7705/files#diff-b19b9543781bcac2d393bd02433cfbc2edd8cb95e79fff1f550e9e21455c32c3
View file https://github.com/TheAlgorithms/Java/blob/729f428540419f17f338e2956ef3e3d255b77c85/src/main/java/com/thealgorithms/backtracking/MazeRecursion.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/TheAlgorithms/Java/pull/7705/{{ revealButtonHref }}
https://github.com/TheAlgorithms/Java/pull/7705/files#diff-b19b9543781bcac2d393bd02433cfbc2edd8cb95e79fff1f550e9e21455c32c3
https://github.com/TheAlgorithms/Java/pull/7705/files#diff-b19b9543781bcac2d393bd02433cfbc2edd8cb95e79fff1f550e9e21455c32c3
https://github.com/TheAlgorithms/Java/pull/7705/files#diff-b19b9543781bcac2d393bd02433cfbc2edd8cb95e79fff1f550e9e21455c32c3
https://github.com/TheAlgorithms/Java/pull/7705/files#diff-b19b9543781bcac2d393bd02433cfbc2edd8cb95e79fff1f550e9e21455c32c3
https://github.com/TheAlgorithms/Java/pull/7705/files#diff-b19b9543781bcac2d393bd02433cfbc2edd8cb95e79fff1f550e9e21455c32c3
https://github.com/TheAlgorithms/Java/pull/7705/files#diff-b19b9543781bcac2d393bd02433cfbc2edd8cb95e79fff1f550e9e21455c32c3
https://github.com/TheAlgorithms/Java/pull/7705/files#diff-b19b9543781bcac2d393bd02433cfbc2edd8cb95e79fff1f550e9e21455c32c3
https://github.com/TheAlgorithms/Java/blob/master/.github/CODEOWNERS#L1
src/test/java/com/thealgorithms/backtracking/MazeRecursionTest.javahttps://github.com/TheAlgorithms/Java/pull/7705/files#diff-11826e83d703952b45d747c1bf8f823016047330eba6d33d203ef74a464def64
View file https://github.com/TheAlgorithms/Java/blob/729f428540419f17f338e2956ef3e3d255b77c85/src/test/java/com/thealgorithms/backtracking/MazeRecursionTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/TheAlgorithms/Java/pull/7705/{{ revealButtonHref }}
https://github.com/TheAlgorithms/Java/pull/7705/files#diff-11826e83d703952b45d747c1bf8f823016047330eba6d33d203ef74a464def64
Please reload this pagehttps://github.com/TheAlgorithms/Java/pull/7705/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.