Re: can I do better that binary search

From: Richard Harter (cri_at_tiac.net)
Date: 05/29/04


Date: Sat, 29 May 2004 05:21:42 GMT

On 27 May 2004 18:40:55 +0530, Abi <abi_kREMSPAM@myrealbox.com> wrote:

>Could you be more specific. I didn't get much of it though what I'm
>looking for is something similar, I'm donot want to reduce total
>computational cost but only the number of comparisons and the elements
>are put into the array in sorted order one by one.
>abi

Your latter statement, "the elements are put into the array in sorted
order one by one" require amplification. Are we talking about a
static array (searches are done after all elements are entered) or a
dynamic array (the array can change between searches)? If it is a
dynamic array are elements added only at the end points or can they be
inserted into the interior of the array?

Richard Harter, cri@tiac.net
http://home.tiac.net/~cri, http://www.varinoma.com
A university is what a college becomes when the faculty
loses interest in students. - John Ciardi



Relevant Pages

  • Re: how to return mulitple corresponding values
    ... I know what the formula does but what do you mean by: sorted order i.e.the ... "Biff" wrote: ... It's not actually multiplying numbers. ... These logicals are multiplied together and result in an array of 1's ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Puzzle
    ... Siddharth Taneja wrote: ... form an array which lists the integers just ... and then their duplicates in sorted order. ... void print_array(int * a, size_t num) { ...
    (comp.lang.c)
  • Re: how can i do this in o(n)
    ... > A given array of size 2n with n elements in sorted order. ... You can compare the last card in each deck, and move the highest value card ...
    (comp.lang.c)
  • Re: parsing directory
    ... i need to parse a folder in my system and create an array containing ... the fully qualified names of all .png files in sorted order,ie in ...
    (comp.lang.c)
  • Re: How many bytes per Italian character?
    ... Write the code to insert a new element in sorted order" and of 27 interviewees, 26 failed to do it, and the only one who got it right was a PhD candidate, and she struggled to get it. ... I can do it with both LRU optimization for lookup and sublinear insert performance for large lists without thinking too hard about it. ... If with list we mean array, I could do a kind of binary search to find the place of insertion, and then insert. ... If Dr. Newcomer's caching succeeds then he doesn't have to visit all previous K-1 elements. ...
    (microsoft.public.vc.mfc)