Skip to content

Conversation

@mateuseap
Copy link

No description provided.

Copy link

@Spikatrix Spikatrix left a comment

Choose a reason for hiding this comment

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

Please remove the large non-english comment. Also, the main function does not call the binarySearch function in your code

As you asked, I removed my large Portuguese comment that was explaining my code, and now I'm calling the function binarySearch in the main function and using it (I explained with comments in English what I'm doing).
@mateuseap
Copy link
Author

Please remove the large non-english comment. Also, the main function does not call the binarySearch function in your code

As you asked, I removed my large Portuguese comment that was explaining my code, and now I'm calling the function binarySearch in the main function and using it (I explained with comments in English what I'm doing).


int vet[] = {1,2,3,4,5,6,7,8,9,10}, res; //Here I create a array called vet, with ten positions, and a variable called res

res = binarySearch(vet, 5, 9); //Now I call my binarySearch function, I send to my function my array called vet, the number that I wanna find
Copy link

@Spikatrix Spikatrix Oct 7, 2019

Choose a reason for hiding this comment

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

You should be calling the function with 10 as the last argument, not 9 (binarySearch(vet, 5, 10))

Copy link
Author

Choose a reason for hiding this comment

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

For sure, I didn't saw this, but now I'm passing 10 as the array size, thank u.

I was passing 9 as the array size to my binarySearch function, now I atualized this error and I'm passing 10.
@ashwek ashwek merged commit 5163859 into TheAlgorithms:master Oct 8, 2019
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.

3 participants