Re: how can i do this in o(n)



In article <1126670295.554610.3050@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"kitts" <lanka.kamal@xxxxxxxxx> wrote:

> A given array of size 2n with n elements in sorted order. Another array
> with size n & n elements in it in sorted order. Merge the two arrays &
> final array should be in sorted order without using extra memory

Not possible in o (n).
Trivial in O (n).
.



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)