Skip to content
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

Binary Search #6291

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Binary Search #6291

wants to merge 2 commits into from

Conversation

savi966
Copy link
Contributor

@savi966 savi966 commented Oct 23, 2021

Fixes issue:

Changes:

Copy link
Contributor

@walidbarakat walidbarakat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make your code easier to read by using blank lines.

int solve(int arr[],int n,int target){
int low=0;
int high=n-1;
while(low<=high){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if low is equal to high, so in this case target is not exist, the loop condition should be only (low < high)

@savi966
Copy link
Contributor Author

savi966 commented Oct 27, 2021 via email

Copy link
Member

@AdiChat AdiChat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This directory is for applications of specific algorithms. You may need to move the implementation of Binary Search to another directory.

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.

None yet

3 participants