Feat/tournament sort (#7201)

* feat: implement Smooth Sort algorithm with detailed JavaDoc and test class

* style: format LEONARDO array for improved readability with clang-format

* feat(sorts): add TournamentSort (winner-tree)

* test: add unit test for null array handling in TournamentSort

---------

Co-authored-by: Ahmed Allam <60698204+AllamF5J@users.noreply.github.com>
Co-authored-by: Deniz Altunkapan <deniz.altunkapan@outlook.com>
Co-authored-by: Oleksandr Klymenko <19151554+alxkm@users.noreply.github.com>
This commit is contained in:
Ahmed Allam
2026-01-14 00:04:14 +02:00
committed by GitHub
parent bdda4fa6b4
commit 7148661e44
2 changed files with 103 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
package com.thealgorithms.sorts;
import static org.junit.jupiter.api.Assertions.assertNull;
import org.junit.jupiter.api.Test;
public class TournamentSortTest extends SortingAlgorithmTest {
@Test
void shouldAcceptWhenNullArrayIsPassed() {
Integer[] array = null;
assertNull(getSortAlgorithm().sort(array));
}
@Override
SortAlgorithm getSortAlgorithm() {
return new TournamentSort();
}
}