Skip to content

Add Tournament Sort implementation#1579

Open
drori12 wants to merge 1 commit into
TheAlgorithms:masterfrom
drori12:add-tournament-sort
Open

Add Tournament Sort implementation#1579
drori12 wants to merge 1 commit into
TheAlgorithms:masterfrom
drori12:add-tournament-sort

Conversation

@drori12
Copy link
Copy Markdown

@drori12 drori12 commented Jun 1, 2026

Description of Change

Added Tournament Sort algorithm implementation in C. Tournament Sort improves
upon naive Selection Sort by using a min-heap to find the minimum element in
O(log n) instead of O(n), achieving O(n log n) overall time complexity.

References

https://en.wikipedia.org/wiki/Tournament_sort

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes: Tournament Sort implementation with 6 test cases covering unsorted, sorted, reverse sorted, single element, duplicates, and negative numbers.

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.

1 participant