Re: binary search



"JD" <joydeep.paul@xxxxxxxxx> writes:

> Given a sorted linked list it is required to perform a binary search
> for a particular element. Kindly suggest an optimum algorithm for the
> problem.

Binary search doesn't apply to linked lists (sorted or not). You
need to use a different data structure.
--
"To prepare for the writing of Software,
the writer must first become one with it,
sometimes two."
--W. C. Carlson
.



Relevant Pages

  • Re: a benefit to using a linked list in insertion sort?
    ... The array is sorted. ... You can't use the binary search with the sorted linked list, ... Small sorted linked lists can be searched with reasonable but not ... Use linked lists to make insertions easy, ...
    (comp.programming)
  • Re: Binary Tree
    ... >> I'm trying to do a binary search and collect some stats from a text ... >> searching) versus an old program using linked lists. ... > Here's a couple links to how binary trees work. ... > I talk about uses a three pointer structure that allows me to create ...
    (comp.lang.c)
  • Re: a benefit to using a linked list in insertion sort?
    ... > Use linked lists to make insertions easy, ... > entry) to make deletions easier. ... a single-node history of the traversed nodes. ... > isn't a binary search at all but a hash table. ...
    (comp.programming)
  • Re: binary search
    ... > Given a sorted linked list it is required to perform a binary search ... > Kindly suggest an optimum algorithm for the ... More useful might be an AVL or other balanced tree solution for ...
    (comp.programming)
  • Re: binary search
    ... Kindly suggest an optimum algorithm for the ... Binary search is not a practical solution for linked list. ... Prev by Date: ...
    (comp.programming)