Skip to content

Improve null and edge case handling in BinarySearch implementation #7356

@AbhiramSakha

Description

@AbhiramSakha

What would you like to share?

The current BinarySearch implementation does not explicitly handle certain edge cases such as null input arrays or null search values.

Suggested improvements:

  • Add null check for the input array
  • Handle empty array case
  • Add null check for the search value to prevent potential NullPointerException

This will improve robustness and ensure safer usage of the algorithm.

I would like to work on this issue and submit a PR.

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