Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add Search a 2D Matrix algorithm#7114

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
AHVSSATHVIK wants to merge4 commits intoTheAlgorithms:master
base:master
Choose a base branch
Loading
fromAHVSSATHVIK:add-search-2d-matrix

Conversation

@AHVSSATHVIK
Copy link

Description

This pull request adds theSearch a 2D Matrix algorithm to the directory
src/main/java/com/thealgorithms/matrix/.

This algorithm solves the well-known problem where each row of the matrix is sorted,
and the first element of each row is greater than the last element of the previous row.
A binary search is applied on the virtual 1D representation of the matrix to achieve
O(log(m*n)) time complexity.

A detailed explanation of the problem can be found here:
https://leetcode.com/problems/search-a-2d-matrix/

This implementation includes:

  • Clean binary search logic
  • JavaDoc-style documentation
  • Proper placement within thematrix package

Type of Change

  • New Algorithm (non-breaking addition)
  • Enhancement to the matrix category

Checklist

  • I have readCONTRIBUTING.md.
  • This pull request is all my own work.
  • File name follows PascalCase.
  • Function and variable names follow Java coding conventions.
  • Added the required URL reference in the JavaDoc comment.
  • Code is formatted withclang-format as required.

@codecov-commenter
Copy link

codecov-commenter commentedNov 25, 2025
edited
Loading

Codecov Report

❌ Patch coverage is0% with18 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.43%. Comparing base (1c6026e) to head (3018106).

Files with missing linesPatch %Lines
.../java/com/thealgorithms/matrix/Search2DMatrix.java0.00%18 Missing⚠️
Additional details and impacted files
@@             Coverage Diff              @@##             master    #7114      +/-   ##============================================- Coverage     78.50%   78.43%   -0.07%+ Complexity     6752     6751       -1============================================  Files           759      760       +1       Lines         22402    22420      +18       Branches       4400     4403       +3     ============================================- Hits          17587    17586       -1- Misses         4109     4127      +18- Partials        706      707       +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.

@AHVSSATHVIK
Copy link
Author

i have made the changes

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

Reviewers

@DenizAltunkapanDenizAltunkapanAwaiting requested review from DenizAltunkapanDenizAltunkapan is a code owner

@yanglbmeyanglbmeAwaiting requested review from yanglbmeyanglbme is a code owner

@alxkmalxkmAwaiting requested review from alxkmalxkm is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@AHVSSATHVIK@codecov-commenter

[8]ページ先頭

©2009-2025 Movatter.jp