Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
72 views

pset3: sort and search work in separate files, but my helpers.c doesn't work

I dealt with sorting in a separate file first, and then I dealt with searching in another file. They seem to work okay or at least worked for the numbers I feed in, but when I put them in helpers and ...
Chris's user avatar
  • 19
1 vote
2 answers
104 views

Binary Search Pset 3 help

As my question is titled, I would appreciate help with my binary search, shown below. Currently, the search will always return false. I am almost certain that my sorting algorithm is correct, as it ...
Jason_V's user avatar
  • 182
0 votes
0 answers
51 views

Result doesn't match expected output

I just finished the helpers.c pset, where you have to implement a counting sort and then a binary search. I havent made it recursive yet but it works in all of my own test cases. I also ran the ./...
Tod Lazarov's user avatar
0 votes
1 answer
101 views

pset3 binary search , problems with check50

i have tried a lot but cannot find the meaning of the last two errors of check50 please help
Ketan Verma's user avatar
0 votes
1 answer
81 views

Pset3 recursive binary search function - check50 gives me four :( and I don't know why

I would be really grateful if someone could offer me a hint as to where I'm going wrong with this - I've been stuck for a couple of days now. When I work through the code step by step on paper it ...
J M COOPER's user avatar
0 votes
2 answers
73 views

find.c compiles but fails check50 - I believe binary search is to blame

Why does my code fail check50? This is the code of my binary search. I know it's buggy, and I spent the last hours reading answers to similar questions, the information I found doesn't quite cut it ...
Iury Sikorsky's user avatar
0 votes
1 answer
105 views

Check50 is claiming that it's recieving an exit code of 0 rather than 1 (different scenario)

I know this question has been answered before (pset 3 "search": expected an exit code of 0, not 1), but I took a look at it, and it seems that the scenario in which the person asked the ...
jayfeather31's user avatar
0 votes
1 answer
270 views

Having trouble with pset3 helpers.c binary search

bool search(int value, int values[], int n) { int midpoint = n / 2; int startpoint = 0; int endpoint = n - 1; // if the midpoint doesn't equal the vales we're looking for, repeat this ...
Russell C.'s user avatar
0 votes
1 answer
319 views

Pset3: Helpers.c Binary Search Fails on checks that have 42 entered last

For some reason my implementation of binary search for Pset3 fails to work correctly whenever the last number added to the "haystack" is 42. During use of GDB, I found that this is due to the part of ...
OddballGreg's user avatar
0 votes
1 answer
585 views

Pset3 Search/Find problems

I have no idea what the problems are with this code, so any help would be appreciated. The code compiles, but the output is skewed. It only sorts after a certain amount of characters, and then sorts ...
mmoore's user avatar
  • 57