Skip to content

feat: add PowerSort algorithm - #2044

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

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

Conversation

@YAKSHITH-1

@YAKSHITH-1 YAKSHITH-1 commented Dec 1, 2026 •

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

codecov-commenter commented Dec 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.06%. Comparing base (5c39e87) to head (4dff71e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2044      +/-   ##
==========================================
+ Coverage   85.91%   86.06%   +0.14%     
==========================================
  Files         379      380       +1     
  Lines       19778    19983     +205     
  Branches     3016     3053      +37     
==========================================
+ Hits        16993    17198     +205     
  Misses       2785     2785              

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

@willbyers1 willbyers1 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM!

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

3 participants