Re: [algogeeks] find a point closest to other points

2012-04-25 Thread bharat b
i don't know exactly, mode can be the point P. On 4/25/12, tech coder techcoderonw...@gmail.com wrote: Given N points(in 2D) with x and y coordinates. You have to find a point P (in N given points) such that the sum of distances from other(N-1) points to P is minimum. --  Regards The

[algogeeks] Re: find a point closest to other points

2012-04-25 Thread Navneet
We cannot do it without computing distances of each node from all other nodes. So to begin with, construct a matrix representation of the graph with distances filled in for every pair of points. Proceed to calculate the minimum spanning tree of such a weighted graph. Kruskal's and Prim's are

[algogeeks] Wrong Answer SPOJ

2012-04-25 Thread saurabh singh
I have been trying this problem which is from a past hacker cup.I am getting wrong answer.http://www.spoj.pl/problems/NFACTOR/ My approach: 1.Count the number of prime factors of a number(trivial way) for(int i=2;i*2=100;i++) number_of_factors[i]=1; //atleast 1 factor that is 2 for(int

Re: [algogeeks] Re: find a point closest to other points

2012-04-25 Thread payal gupta
We can calculate the centroid of all d points and then calculate their individual distances from it .The point with the minimum distance will be the answer. TC :O(n) Regards, PAYAL GUPTA On 4/25/12, Navneet navneetn...@gmail.com wrote: We cannot do it without computing distances of each node

[algogeeks] Amazon Interview Question

2012-04-25 Thread Radhakrishnan Venkataramani
How will you implement a graph data structure ? Give an linked implementation as we do not know how many nodes will be there and how many edges will be there. Make a copy of this graph.. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Re: find a point closest to other points

2012-04-25 Thread visu@Airvana
I think if we calculate the center of the graph that will give the solution, to do that 1. find the eccentricity of every node using all pair shortest path algo's ( Floyd warshall). 2. The node which is having min eccentricity is your P. On Wed, Apr 25, 2012 at 6:14 PM, Navneet

[algogeeks] Algorithms by Dasgupta

2012-04-25 Thread Anshul Gupta
Does any one have solution for Algorithms by Dasgupta -- Anshul Gupta -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to

Re: [algogeeks] intra network

2012-04-25 Thread Jnana Sagar
ok...got it On Wed, Apr 25, 2012 at 1:55 PM, Ravi Mohan ravimoha...@gmail.com wrote: you can make apache server over wifi network . make sure the smartphone is able to access your intra network. if u have put both devices on same subnet. On Tue, Apr 24, 2012 at 11:41 PM, Jnana Sagar