-
Notifications
You must be signed in to change notification settings - Fork 20k
Added Javadoc comments: I added Javadoc-style comments to provide doc… #4745
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
Conversation
…umentation for the class and the cutRod method. These comments explain the purpose of the class and method and provide details about their parameters and return values, improving code readability and understandability. Clarified parameter names: I changed the parameter name from arr to price to make it clear that this array represents the prices of different pieces of the rod. This change improves the clarity of the code. Improved variable names: I renamed max_val to maxVal to follow Java naming conventions, where variable names use camelCase. This makes the code more consistent and readable. Added comments within the method: I added comments within the cutRod method to explain its logic. These comments clarify the purpose of the loops and the array val, making it easier for others to understand the code.
I request the maintainer(s) to merge my request using "hacktoberfest-accepted" label. |
@siriak Can you please review and merge this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good, could you please replace main
with some JUnit tests? (see https://github.com/TheAlgorithms/Java/tree/master/src/test/java/com/thealgorithms)
A duplicate of #4744 |
My bad, I thought the changes from this PR are already included in #4744. Let's then wait for it to be merged, and then we will have a better understanding if the refactoring is correct |
But ideally these 2 should be merged together in a single PR |
@siriak I've created 2 PRs because of the separation of concerns. This is related to the refactoring of the Rodcutting class where the core logic remains the same and other PR is related to test cases of the Rodcutting class. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lg
…umentation for the class and the cutRod method. These comments explain the purpose of the class and method and provide details about their parameters and return values, improving code readability and understandability. Clarified parameter names: I changed the parameter name from arr to price to make it clear that this array represents the prices of different pieces of the rod. This change improves the clarity of the code. Improved variable names: I renamed max_val to maxVal to follow Java naming conventions, where variable names use camelCase. This makes the code more consistent and readable. Added comments within the method: I added comments within the cutRod method to explain its logic. These comments clarify the purpose of the loops and the array val, making it easier for others to understand the code.
clang-format -i --style=file path/to/your/file.java