Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Implement binary search

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.

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.

Name: Anonymous 2012-02-16 17:56

>>2
This.

Name: Anonymous 2012-02-16 18:07

>>2-3
fuck you faggot

>>1 google it

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;
}

Name: Anonymous 2012-02-16 20:48

>>5
FV's quality

Name: Anonymous 2012-02-16 20:53

>>5
that's not even remotely close to binary search.

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);
}

Name: Anonymous 2012-02-16 22:37

>>7
I don't know all your stupid rules!

Name: Anonymous 2012-02-16 22:43

Name: Anonymous 2012-02-16 23:10

>>8
Windows mode:

BinarySearch(NULL, NULL, 0, 0, NULL);

Name: Anonymous 2012-02-16 23:22

>>11

SEGMENTATION FAULT

Don't change these.
Name: Email:
Entire Thread Thread List