Re: [algogeeks] max path

2013-05-02 Thread Sharath Channahalli
I think this can be converted into Dijkstra's algorithm to find the minimum distance between the start and end points. (the weights would be negative of the points between two cells). On Mon, Apr 29, 2013 at 4:12 PM, sreekanth guru wrote: > > Problem: > > We have m * n grids. Each grid can have

Re: [algogeeks] Re: Finding elements near the median

2011-01-26 Thread Sharath Channahalli
a) Find the median - O(n) b) remove the element and again find the median c) conitnue b until you get k-1 elements time complexity - kO(n) On Wed, Jan 26, 2011 at 9:55 PM, ritu wrote: > > solution is nice!!but How to keep track of k closet numbers? > > > On Jan 23, 9:22 pm, ritesh wrote: > > 1

Re: [algogeeks] Re: Bit Manipulation

2011-01-17 Thread Sharath Channahalli
I think Q1 is NP hard problem since the number of bits grows exponentially as the array size increases. On Mon, Jan 17, 2011 at 1:13 PM, juver++ wrote: > @awesomeandroid > Your solution for Q1 is wrong. It can be applied only for such numbers N = > 2^k, so number should power of 2. > > -- > You