1
Name:
Anonymous
2012-02-16 17:28
Implement a correct and working binary search algorithm in your language of choice. Be clever. I know you can make your code interesting .
2
Name:
Anonymous
2012-02-16 17:39
Baby's first algorithm's assignment, right? Why don't you just visit your TA during their office hours, and let them know that you haven't been following class or reading the textbook.
5
Name:
Anonymous
2012-02-16 18:32
int *x = array[size/2];
Top:
for (int o = 0; o< size/2; o++){
if(array[o] == item) { cout << found it boss; break;}
if (*x ==item) {cout << black jewish liberation front; break;}
else x++;
}
if (x != o) { goto top;}
return 1;
}
7
Name:
Anonymous
2012-02-16 20:53
>>5
that's not even remotely close to binary search.
8
Name:
Anonymous
2012-02-16 21:13
void *BinarySearch(const void *key, const void *base, size_t nel, size_t width, int (*compar)(const void *, const void *)) {
return bsearch(key, base, nel, width, compar);
}
9
Name:
Anonymous
2012-02-16 22:37
>>7
I don't know all your stupid rules!