Class ModeTest

java.lang.Object
topics.divideconquer.mode.ModeTest

@DisplayName("Mode Calculation Paradigms") class ModeTest extends Object

Validation Suite for Mode Algorithms

Verifies both quadratic and linearithmic approaches accurately calculate the mode and its frequency.

Author:
vicegd
  • Constructor Details

    • ModeTest

      ModeTest()
  • Method Details

    • setup

      @BeforeAll static void setup()
    • shouldCalculateModeNaive

      @Test @DisplayName("Naive O(N^2): Calculate the mode of a mixed array") void shouldCalculateModeNaive()
    • shouldCalculateModeSorting

      @Test @DisplayName("Sorting O(N log N): Calculate the mode of a mixed array") void shouldCalculateModeSorting()
    • shouldNotMutateOriginalArray

      @Test @DisplayName("Validation: Arrays must not be mutated by the calculation") void shouldNotMutateOriginalArray()