Re: [algogeeks] Give Algo to do this in O(n)

2011-10-10 Thread sandeep nagamalli
@Shiva: How can min heap be uesd, can you eloborate a bit. As far as i see, the best possible is O(nlogn) i.e by sorting and scanning over the complete array once. On Mon, Oct 10, 2011 at 9:49 AM, shiva@Algo shiv.jays...@gmail.com wrote: I think Min heap will do that.. On Mon, Oct 10,

Re: [algogeeks] Re: google maps

2011-09-20 Thread sandeep nagamalli
Well, I think its not that the algorithm be written with all Google maps features in place. Rather it is a open ended question, where interviewer is trying to find the candidates view of algorithm design. @Deepak: It should be fine even if some reasonably good algo is given. my 2 cents: For the

Re: [algogeeks] ms question

2011-09-12 Thread sandeep nagamalli
I think it is 1 / (2N) (1/N) * (1/N)*(N/2) = 1/(2N) On Mon, Sep 12, 2011 at 6:33 PM, Akash Mukherjee akash...@gmail.com wrote: this is a case, but isnt der a case of circular permutation 2?? what say abt dis 0,1 2,3 4,5 0,1 2,3 4,5 it wrks i gues?? On Mon, Sep 12, 2011 at 12:56 PM,