TheAlgorithms / Java

All Algorithms implemented in Java
MIT License
60.18k stars 19.46k forks source link

Update EggDropping.java #6047

Open manishraj27 opened 4 weeks ago

manishraj27 commented 4 weeks ago

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.

codecov-commenter commented 4 weeks ago

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 :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

manishraj27 commented 4 weeks ago

@siriak please review it!