Skip to content

Add MedianOfTwoSortedArrays.java new algorithm #5554

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Oct 9, 2024

Conversation

Hardvan
Copy link
Contributor

@Hardvan Hardvan commented Oct 3, 2024

  • 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.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

@codecov-commenter
Copy link

codecov-commenter commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 77.27273% with 5 lines in your changes missing coverage. Please review.

Project coverage is 58.23%. Comparing base (2592a08) to head (654b635).
Report is 19 commits behind head on master.

Files with missing lines Patch % Lines
...thms/divideandconquer/MedianOfTwoSortedArrays.java 77.27% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5554      +/-   ##
============================================
+ Coverage     55.97%   58.23%   +2.26%     
- Complexity     3535     3701     +166     
============================================
  Files           544      550       +6     
  Lines         15704    15872     +168     
  Branches       2988     3023      +35     
============================================
+ Hits           8790     9243     +453     
+ Misses         6545     6234     -311     
- Partials        369      395      +26     

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

@Hardvan Hardvan marked this pull request as ready for review October 3, 2024 15:03
@alxkm
Copy link
Contributor

alxkm commented Oct 3, 2024

It looks like it's leetcode, so according to the rules of this repository it can't be added.

https://github.com/TheAlgorithms/Java/blob/master/CONTRIBUTING.md

What do you think @siriak

@Hardvan
Copy link
Contributor Author

Hardvan commented Oct 4, 2024

I understand the concern about it being a LeetCode problem. However, I believe this implementation touches on a valid algorithm that has practical applications. Given its relevance and utility in algorithm studies, I think it warrants consideration for inclusion in the repository.

@siriak
Copy link
Member

siriak commented Oct 5, 2024

@Hardvan could you provide some links that explain this algorithm and its applications outside of leetcode context? If no, we cannot include it as it's too specific and only appears in the context of coding competitions.

@Hardvan
Copy link
Contributor Author

Hardvan commented Oct 5, 2024

@siriak The Algorithms/Python repository includes the "Median of Two Sorted Arrays" algorithm as part of its directory, indicating it is recognized as a valid algorithm beyond coding competitions.

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

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

Ok then resolve conflicts and I'll review

@Hardvan
Copy link
Contributor Author

Hardvan commented Oct 7, 2024

Conflicts resolved!

@Hardvan
Copy link
Contributor Author

Hardvan commented Oct 8, 2024

I have refactored the test code to use Parameterized tests instead,

@Hardvan Hardvan requested a review from siriak October 8, 2024 09:55
siriak
siriak previously approved these changes Oct 9, 2024
@siriak siriak merged commit 5c79e5d into TheAlgorithms:master Oct 9, 2024
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.

4 participants