Class MergesortTest

java.lang.Object
topics.sorting.mergesort.MergesortTest

class MergesortTest extends Object

Validation Suite for Mergesort

Verifies the recursive partitioning and O(N) linear merging capabilities of the algorithm using JUnit 5.

Author:
vicegd
  • Constructor Details

    • MergesortTest

      MergesortTest()
  • Method Details

    • setup

      @BeforeAll static void setup()
    • shouldSortSmallMixedSequence

      @Test void shouldSortSmallMixedSequence()

      Scenario: Small array with mixed inversions.

    • shouldSortLargeReversedSequence

      @Test void shouldSortLargeReversedSequence()

      Scenario: A large array consisting of exactly 1,000 elements strictly in reverse order.

      Observation: Evaluates the algorithm's performance when encountering the theoretical worst-case structural alignment for many algorithms.