Skip to content

Artemis: Refactor and Optimize Methods in the Double Class#36

Open
mike-turintech wants to merge 1 commit intomainfrom
artemis-161f15ae-aa5b-442a-8ce6-b0f7e044600f
Open

Artemis: Refactor and Optimize Methods in the Double Class#36
mike-turintech wants to merge 1 commit intomainfrom
artemis-161f15ae-aa5b-442a-8ce6-b0f7e044600f

Conversation

@mike-turintech
Copy link
Copy Markdown
Member

This pull request introduces significant optimizations and refactoring in the Double class. Key changes include:

  1. Optimized the sumSquare method to reduce time complexity from O(n^2) to O(n) by removing nested loops.
  2. Refined the sumTriangle method to improve efficiency from O(n^2) to O(n) by updating the loop range and using a direct formula.
  3. Revised the countPairs method to utilize a HashMap for counting occurrences, enhancing performance from O(n^2) to O(n).
  4. Simplified the countDuplicates method by eliminating unnecessary inner loops, improving clarity and efficiency.

Overall, these changes enhance performance and readability, aligning with best practices for code optimization.

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.

2 participants