[algogeeks] finding closest points

2011-11-22 Thread ganesha
Given a set of points in 2D space, how to find the k closest points for a given point, in time better than nlgn. -- 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

[algogeeks] SPOJ STRDIST

2011-06-26 Thread ganesha
http://www.spoj.pl/problems/STRDIST/ Getting WA repeatedly. Can someone help me with the below code. #include iostream #include string #include stdio.h #include algorithm using namespace std; int main() { int k,l; scanf(%d %d,k,l); string str1 = ; string str2

[algogeeks] exon chaining

2011-05-11 Thread ganesha
Can some one help in finding out the bug in the below code. Input: (left,right,weight) representing intervals Output: maximum weight of non-overlapping intervals #include iostream #include vector #include math.h #include algorithm struct point { int value; bool isLeft;

[algogeeks] Re: Compositions of a number

2011-03-21 Thread ganesha
Can you tell me the name of the equivalent SPOJ problem ? On Mar 21, 6:23 pm, Azazle simon monsieur@gmail.com wrote: Dude, its spoj pbm and see eular diagram On 3/20/11, ganesha suresh.iyenga...@gmail.com wrote: Given a number n, write a program to output its various compositions

[algogeeks] Compositions of a number

2011-03-20 Thread ganesha
Given a number n, write a program to output its various compositions where order is not important. For eg, for 5, it will be 1 + 4 1 + 1 + 3 1 + 1 + 1 + 2 1 + 1 + 1 + 1 + 1 1 + 2 + 2 and so on Order is not important implies 1 + 4 is same as 4 + 1. Modify the program such that the order is