Skip to content

Handle null and empty array cases in IterativeBinarySearch #7330

@AbhiramSakha

Description

@AbhiramSakha

What would you like to share?

The current IterativeBinarySearch implementation does not handle null or empty arrays.

Issues:

  • Passing null causes NullPointerException
  • Empty arrays are not handled explicitly

Suggested fix:

  • Add null and length checks before processing

This improves robustness and prevents runtime errors.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting triageAwaiting triage from a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions