4
votes
Accepted
Question about binary search. Please help!
Even or odd, it doesn't really matter. The point is that you are dividing the list approximately in half, give or take. If the split doesn't occur exactly at the middle (odd number of elements), it ...
1
vote
Accepted
cs50 pset3 binary search
You are getting this error message because, apparently the compiler couldn't find the main function in your program. Most probably you are compiling your code like this:
make helpers
the compiler ...
1
vote
Accepted
Binary search implementation help please
Binary search means:
You have a search interval, with left and right boundary.
Is the interval empty?
Yes => :( Value not found
No => keep doing
Calculate the middle index of the interval
You ...
1
vote
Recursive binary function returns error: control reaches end of non-void function
Your binarysearch function follows this logic:
if (something)
{
if (something_else)
{
else
{
/* ... */
}
/* **ERR:NOTHING_IS_RETURNED** */
// Here you must add a ...
Only top scored, non community-wiki answers of a minimum length are eligible