Re: binary search
- From: Randy Howard <randyhoward@xxxxxxxxxxxxxxxxx>
- Date: Wed, 27 Jul 2005 20:04:36 GMT
JD wrote
(in article
<1122488288.786917.293670@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>):
> Given a sorted linked list it is required to perform a binary search
> for a particular element.
Then you will probably be better off storing the elements of the
list in a different data structure which lends itself to such
things.
> Kindly suggest an optimum algorithm for the
> problem.
arrays are commonly used for this. Binary search *is* the
algorithm.
More useful might be an AVL or other balanced tree solution for
real-world projects.
Is this homework? If it's a real world problem, describe what
you are actually trying to achieve.
--
Randy Howard (2reply remove FOOBAR)
.
- Follow-Ups:
- Re: binary search
- From: JD
- Re: binary search
- References:
- binary search
- From: JD
- binary search
- Prev by Date: Re: What things should successful programmers-to-be learn right now?
- Next by Date: Re: C++ different learning styles
- Previous by thread: Re: binary search
- Next by thread: Re: binary search
- Index(es):
Relevant Pages
|