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

Implement improvements in the modeArray method #208

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

Conversation

GeriMultiDev
Copy link

This commit implements significant improvements in the modeArray method to enhance its efficiency and handle cases of multiple modes or the absence of number repetition. I have optimized the calculation of the frequency of each element, updated the algorithm to find the maximum frequency value, and added handling to correctly build the array of modes. Additionally, I have added comments to document the changes made in the code and improve its readability

This commit implements significant improvements in the modeArray method to enhance its efficiency and handle cases of multiple modes or the absence of number repetition. I have optimized the calculation of the frequency of each element, updated the algorithm to find the maximum frequency value, and added handling to correctly build the array of modes. Additionally, I have added comments to document the changes made in the code and improve its readability
Copy link
Owner

@iluwatar iluwatar left a comment

Choose a reason for hiding this comment

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

Checkstyle is failing the build. Format the code according to Google style.

Corrected the calculation of the array size frequency in the modeArray method to handle negative numbers properly.
Now it calculates the range of numbers in the array and adjusts the size of the frequency array accordingly.
Updated test cases in the ArrayModeSnippetTest file to reflect these changes.
Copy link

sonarcloud bot commented May 7, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants