Skip to content

Improve space complexity to O(1) in WordSearch.#7308

Merged
DenizAltunkapan merged 10 commits intoTheAlgorithms:masterfrom
Maryamh12:marii-newChanges
Mar 14, 2026
Merged

Improve space complexity to O(1) in WordSearch.#7308
DenizAltunkapan merged 10 commits intoTheAlgorithms:masterfrom
Maryamh12:marii-newChanges

Conversation

@Maryamh12
Copy link
Contributor

  • [ 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

@codecov-commenter
Copy link

codecov-commenter commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.41%. Comparing base (8bbd090) to head (bf35e74).

Files with missing lines Patch % Lines
...ava/com/thealgorithms/backtracking/WordSearch.java 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #7308      +/-   ##
============================================
- Coverage     79.44%   79.41%   -0.03%     
+ Complexity     7061     7060       -1     
============================================
  Files           788      788              
  Lines         23129    23120       -9     
  Branches       4548     4545       -3     
============================================
- Hits          18374    18361      -13     
- Misses         4021     4024       +3     
- Partials        734      735       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@DenizAltunkapan DenizAltunkapan left a comment

Choose a reason for hiding this comment

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

Thank you for the improved implementation - using in-place marking instead of a separate visited array simplifies the code and reduces memory overhead. @Maryamh12

@DenizAltunkapan DenizAltunkapan enabled auto-merge (squash) March 14, 2026 21:13
@DenizAltunkapan DenizAltunkapan merged commit 24c2bea into TheAlgorithms:master Mar 14, 2026
7 checks passed
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.

3 participants