Skip to content

Binary-Search-1 Completed #2323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bhavanamalaga
Copy link

No description provided.

@super30admin
Copy link
Owner

Strengths:

  • The solution correctly implements binary search on a rotated array.
  • The code is well-commented and easy to understand.
  • The use of helper functions improves modularity and readability.

Areas for Improvement:

  • The condition nums[mid+1] <= target in the else block could cause an out-of-bounds error if mid is the last element. Consider checking mid < high before accessing nums[mid+1].
  • The comments could be more concise and focused on the key insights rather than repeating the code logic.
  • The variable names could be more descriptive (e.g., l and h could be low and high for consistency).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants