Hot answers tagged

1

You do not have to (even are not allowed to) change find and generate. Most probably, in you sort function you do something wrong with haystack. Run debug50 with ./ find 42; 50, 43 and look at your few variables inside sort.


1

Is bubble sort working? Is linear search working? These are two different questions. I'll skip the sort for now, since the linear search is the immediate problem. (Besides, you can test the sort simply by adding some temporary code to print out the list at the end of sort.) Let's take a close look at the linear search function. It checks whether n<0, ...


Only top voted, non community-wiki answers of a minimum length are eligible