Skip to content

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

Merged
merged 3 commits into from
Nov 11, 2023

Conversation

sunilnitdgp
Copy link
Contributor

@sunilnitdgp sunilnitdgp commented Oct 9, 2023

…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 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

…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.
@sunilnitdgp
Copy link
Contributor Author

I request the maintainer(s) to merge my request using "hacktoberfest-accepted" label.

@sunilnitdgp
Copy link
Contributor Author

@siriak Can you please review and merge this?

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.

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)

@sunilnitdgp
Copy link
Contributor Author

@siriak I've already raised a PR for the unit tests of this class, you can find the PR here: #4744

@siriak
Copy link
Member

siriak commented Oct 11, 2023

A duplicate of #4744

@siriak siriak closed this Oct 11, 2023
@sunilnitdgp
Copy link
Contributor Author

@siriak Why this is being closed? #4744 is related to test cases and the current PR is regarding the code refactoring

@siriak
Copy link
Member

siriak commented Oct 11, 2023

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

@siriak siriak reopened this Oct 11, 2023
@siriak
Copy link
Member

siriak commented Oct 11, 2023

But ideally these 2 should be merged together in a single PR

@sunilnitdgp
Copy link
Contributor Author

@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.

Copy link

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.

@github-actions github-actions bot added the stale label Nov 11, 2023
Copy link
Member

@debasishbsws debasishbsws left a comment

Choose a reason for hiding this comment

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

Lg

@debasishbsws debasishbsws enabled auto-merge (squash) November 11, 2023 15:25
@siriak siriak merged commit c527dff into TheAlgorithms:master Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants