Skip to content

feat: add PowerSort algorithm - #2044

Open
YAKSHITH-1 wants to merge 1 commit into
TheAlgorithms:masterfrom
YAKSHITH-1:feat/powersort
Open

YAKSHITH-1 wants to merge 1 commit into
TheAlgorithms:masterfrom
YAKSHITH-1:feat/powersort

Conversation

@YAKSHITH-1

Copy link
Copy Markdown

Fixes: #2042

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Implemented PowerSort under the Sorts directory.

  • Added natural run detection and reversal.
  • Implemented binary insertion sort to extend short runs.
  • Added node power calculation for merge scheduling.
  • Implemented merging of adjacent sorted runs.
  • Added tests for empty arrays, duplicates, sorted arrays, reverse-sorted arrays, and multiple natural runs.

@YAKSHITH-1
YAKSHITH-1 requested a review from appgurueu as a code owner December 1, 2026 15:15
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.56098% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.03%. Comparing base (5c39e87) to head (4537784).

Files with missing lines Patch % Lines
Sorts/PowerSort.js 97.56% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2044      +/-   ##
==========================================
+ Coverage   85.91%   86.03%   +0.11%     
==========================================
  Files         379      380       +1     
  Lines       19778    19983     +205     
  Branches     3016     3050      +34     
==========================================
+ Hits        16993    17193     +200     
- Misses       2785     2790       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

[FEATURE]: Add PowerSort algorithm under Sorts

2 participants