Skip to content

Add iterative implementation alongside recursive BinarySearch #7329

@AbhiramSakha

Description

@AbhiramSakha

What would you like to share?

The current BinarySearch implementation uses a recursive approach, which is clear and well-documented.

However, an iterative version of binary search could be added alongside it for better comparison and performance understanding.

Benefits:

  • Avoids recursion overhead
  • Uses constant space O(1)
  • Easier to understand for beginners in some cases

Suggestion:
Add an iterative version of binary search in the same package for completeness and learning purposes.

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