mirror of
https://github.com/TheAlgorithms/Java.git
synced 2026-03-13 08:40:43 +08:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user