Skip to content

Added tournament sort algorithm#1046

Merged
siriak merged 5 commits into
TheAlgorithms:masterfrom
remememe:master
Jun 16, 2026
Merged

Added tournament sort algorithm#1046
siriak merged 5 commits into
TheAlgorithms:masterfrom
remememe:master

Conversation

@remememe

Copy link
Copy Markdown
Contributor

Description

Implements tournament sort algorithm.
https://en.wikipedia.org/wiki/Tournament_sort

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I ran bellow commands using the latest version of rust nightly.
  • I ran cargo clippy --all -- -D warnings just before my last commit and fixed any issue that was found.
  • I ran cargo fmt just before my last commit.
  • I ran cargo test just before my last commit and all tests passed.
  • I added my algorithm to the corresponding mod.rs file within its own folder, and in any parent folder(s).
  • I added my algorithm to DIRECTORY.md with the correct link.
  • I checked COUNTRIBUTING.md and my code follows its guidelines.

@remememe remememe requested a review from imp2002 as a code owner June 12, 2026 22:51
@codecov-commenter

codecov-commenter commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.85%. Comparing base (fa0aa80) to head (7c6bc51).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1046      +/-   ##
==========================================
+ Coverage   95.84%   95.85%   +0.01%     
==========================================
  Files         394      395       +1     
  Lines       30084    30160      +76     
==========================================
+ Hits        28833    28909      +76     
  Misses       1251     1251              

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

@remememe

Copy link
Copy Markdown
Contributor Author

@siriak Hello could you please take a look at this PR when you have a moment?

Copilot AI 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.

Pull request overview

Adds a new sorting algorithm implementation (tournament sort) to the sorting module and wires it into the module exports and repository directory index.

Changes:

  • Introduces tournament_sort implementation and unit tests in src/sorting/tournament_sort.rs.
  • Exports the new algorithm from src/sorting/mod.rs.
  • Adds the algorithm link to DIRECTORY.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/sorting/tournament_sort.rs New tournament sort implementation + tests.
src/sorting/mod.rs Registers the new module and re-exports tournament_sort.
DIRECTORY.md Adds the new algorithm to the Sorting section index.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/sorting/tournament_sort.rs Outdated
Comment thread src/sorting/tournament_sort.rs
Comment thread src/sorting/tournament_sort.rs Outdated
@siriak

siriak commented Jun 16, 2026

Copy link
Copy Markdown
Member

Please check Copilot's comments if they are relevant

@remememe

remememe commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@siriak I’ve made the necessary changes, and it should be ready for merging.

@siriak siriak requested a review from Copilot June 16, 2026 20:00

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread src/sorting/tournament_sort.rs Outdated
Comment thread src/sorting/tournament_sort.rs
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@siriak siriak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, thanks!

@siriak siriak merged commit 8ba3163 into TheAlgorithms:master Jun 16, 2026
7 checks passed
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.

4 participants