Class BinarySearchTest

java.lang.Object
topics.divideconquer.search.BinarySearchTest

@DisplayName("Binary Search Optimization") class BinarySearchTest extends Object

Validation Suite for Binary Search

Ensures correct target location across both Iterative and Recursive paradigms. Requires a strictly sorted array to function correctly.

Author:
vicegd
  • Constructor Details

    • BinarySearchTest

      BinarySearchTest()
  • Method Details

    • setup

      @BeforeAll static void setup()
    • shouldFindElementIteratively

      @Test @DisplayName("Iterative: Should find existing element in sorted array") void shouldFindElementIteratively()
    • shouldReturnMinWhenNotFoundIteratively

      @Test @DisplayName("Iterative: Should return MIN_VALUE when element does not exist") void shouldReturnMinWhenNotFoundIteratively()
    • shouldFindElementRecursively

      @Test @DisplayName("Recursive: Should find existing element in sorted array") void shouldFindElementRecursively()
    • shouldReturnMinWhenNotFoundRecursively

      @Test @DisplayName("Recursive: Should return MIN_VALUE when element does not exist") void shouldReturnMinWhenNotFoundRecursively()