Skip to content
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

Update EggDropping.java #6047

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

manishraj27
Copy link
Contributor

Changes Made

  1. Improved Documentation

    • Added comprehensive class-level JavaDoc
    • Added detailed method documentation with @param and @return tags
    • Added time and space complexity analysis (O(nmm) time, O(n*m) space)
    • Added comments explaining DP state transitions and base cases
  2. Code Quality Improvements

    • Made class final and constructor private (utility class best practice)
    • Added try-catch block in main method for better error handling

The core dynamic programming algorithm remains unchanged, maintaining its educational value while improving code quality and documentation.

  • 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 28, 2024

Codecov Report

Attention: Patch coverage is 65.00000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 72.96%. Comparing base (fd14016) to head (0ae0173).

Files with missing lines Patch % Lines
.../thealgorithms/dynamicprogramming/EggDropping.java 65.00% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6047      +/-   ##
============================================
- Coverage     72.97%   72.96%   -0.01%     
+ Complexity     5029     5028       -1     
============================================
  Files           655      655              
  Lines         17588    17590       +2     
  Branches       3387     3386       -1     
============================================
+ Hits          12834    12835       +1     
- Misses         4262     4263       +1     
  Partials        492      492              

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

@manishraj27
Copy link
Contributor Author

@siriak please review it!

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.

Please replace main with JUnit tests

## Changes Made

1. Improved Documentation
   - Added comprehensive class-level JavaDoc
   - Added detailed method documentation with @param and @return tags
   - Added time and space complexity analysis (O(n*m*m) time, O(n*m) space)
   - Added comments explaining DP state transitions and base cases

2. Code Quality Improvements
   - Made class final and constructor private (utility class best practice)
   - Added try-catch block in main method for better error handling


The core dynamic programming algorithm remains unchanged, maintaining its educational value while improving code quality and documentation.
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