Questions tagged [binary-search]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
2answers
4k views

Pset3 Binary Search problems

I have tested the code presented in the picture and find this function always returns false no matter what number you search.There must be a problem in it but I can not see it!! Can anyone help me ? ...
0
votes
0answers
235 views

pset3 find: Bus error (core dumped)

I finished the binary search algorithm and I get an error Bus error (core dumped) when I try to test it using the generate tool which is given. However, it works fine when I input the haystacks myself....
0
votes
1answer
514 views

pset 3 “search”: expected an exit code of 0, not 1

I'm at the very end of the "find, sort, search" section of pset3, but when using check50, I get "expected an exit code of 0, not 1". This only happens on the checks where check50 is looking for a ...
0
votes
1answer
102 views

Is it okay to check my code against a reference book?

Alright, so I've been having trouble making binary search (I think I either made an asymptote, or it degrades too quickly.), so I decided to see if my reference book had anything on Binary Search. It ...
0
votes
0answers
214 views

PSET3 \ expected an exit code of 0, not 1 (find.c)

I successfully built my program and went on to check it using check50 only to discover this :) helpers.c exists :) helpers.c compiles :) finds 42 in {42,43,44} :) finds 42 in {41,42,43} :) finds 42 ...