I need HELP doing a binary search
Author Message
I need HELP doing a binary search

Just curious, if the array is already in order, why do you need a binary
search routine. Also, since your array is so small, why not the brute force
sequential search & compare method?

I may be misunderstanding the question - are you wondering about using a
binary tree to store this array and use that for searching? If so, and your
array is in order already, that may not be the best way of doing a search.

Joe Clark

Quote:
>I need HELP doing a binary search on an array.  The array is a list of 20
> animals and they will be in alpha order.  CountersA is the name of array
and
> CountersA(1)
>is cat, etc.

Tue, 21 Mar 2000 03:00:00 GMT
I need HELP doing a binary search

I need HELP doing a binary search on an array.  The array is a list of 20
animals and they will be in alpha order.  CountersA is the name of array and
CountersA(1)
is cat, etc.

Tue, 21 Mar 2000 03:00:00 GMT
I need HELP doing a binary search

On Fri, 3 Oct 1997 13:42:29 -0700, "Joe Clark"

Quote:

> Just curious, if the array is already in order, why do you need a binary
>search routine. Also, since your array is so small, why not the brute force
>sequential search & compare method?

<snip>

Looks like he just wants help with his homework, Joe.

--
Paul Marshall

Wed, 22 Mar 2000 03:00:00 GMT
I need HELP doing a binary search

Quote:

> On Fri, 3 Oct 1997 13:42:29 -0700, "Joe Clark"

> > Just curious, if the array is already in order, why do you need a binary
> >search routine. Also, since your array is so small, why not the brute force
> >sequential search & compare method?
> <snip>
> Looks like he just wants help with his homework, Joe.

Ohh, no! It was in part all the "do my homework" posts that drove

been a few years, and we have better filtering technologies now.
:-)

Anyway, I mainly wanted to point out that a binary search *requires*
that the data already be sorted, since it's an algorithm for looking
up data quickly, rather than a sorting method. For a small array,
however, a sequential search may indeed be just as efficient.

[snip]

--

WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!

Wed, 22 Mar 2000 03:00:00 GMT

 Page 1 of 1 [ 4 post ]

Relevant Pages