[algogeeks] please help..

2011-02-24 Thread Akshata Sharma
http://www.spoj.pl/problems/PIGBANK/ can anyone give me an idea how to solve this problem...?? I dont think the knapsack algo would be of help here as here we need to find minimum value..please refer to the link and if anyone can help, i would be very thankful. regards, aksha -- You received

[algogeeks] Interpreting function declaration

2011-02-24 Thread samta sinha
What does the compiler do when it encounters a function declaration?For instance on encountering a variable declarations it reserves memory space.Does it do this for a function as well or simply takes it as an introduction to the function that will be called? -- You received this message

Re: [algogeeks] Re: Lets C Who Really Loves Perfect Square .................

2011-02-24 Thread ashish agarwal
@dave..Can you please explain your logic .. Regards, Ashish On Thu, Feb 24, 2011 at 6:32 AM, Dave dave_and_da...@juno.com wrote: Try this: int i,k,n; long long j,nsq; for( n = 31623 ; n 10 ; ++n ) { nsq = (long long)n * (long long)n;

Re: [algogeeks] Pairwise Sum Array

2011-02-24 Thread ashish agarwal
I think.. As like no are a,b,c,d,e so sum will be a+b,a+c,a+d,a+e,b+c,b+d,b+e,c+d,c+e,d+e; so maximuum value will be d+e which is last element of array given take last three value 1.c+d 2.c+e 3.d+e eq(1)-eq(2)=d-e; solving it with 3rd eq will give d and e and with these value we can get other

Re: [algogeeks] Pairwise Sum Array

2011-02-24 Thread ashish agarwal
There must be another good solution..please let me know . Thanks On Thu, Feb 24, 2011 at 5:09 PM, ashish agarwal ashish.cooldude...@gmail.com wrote: I think.. As like no are a,b,c,d,e so sum will be a+b,a+c,a+d,a+e,b+c,b+d,b+e,c+d,c+e,d+e; so maximuum value will be d+e which is last

[algogeeks] Re: intel puzzle

2011-02-24 Thread awesomeandroid
The only way to get an acute triangle this way is to connect the diagonals of three adjacent faces. You can select 3 adjacent faces of a cube in (6*4*2)/(3*2*1) = 8 different ways. Regards Priyaranjan http://code-forum.blogspot.com On Feb 23, 12:10 am, jalaj jaiswal jalaj.jaiswa...@gmail.com

Re: [algogeeks]

2011-02-24 Thread ashish agarwal
The basic solution which is coming to the mind is to covert string first palindrome and apply livishthein distance to both string(original one and changed string) to check how many substiutions you require for the palindrome. On Wed, Feb 23, 2011 at 9:11 PM, radha krishnan

Re: [algogeeks]

2011-02-24 Thread Balaji S
how to solve it using DP?? -- 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 algogeeks+unsubscr...@googlegroups.com. For more

Re: [algogeeks] Pairwise Sum Array

2011-02-24 Thread saurabh agrawal
Last three values could be: 1.b+e 2.c+e 3.d+e On Thu, Feb 24, 2011 at 5:09 PM, ashish agarwal ashish.cooldude...@gmail.com wrote: I think.. As like no are a,b,c,d,e so sum will be a+b,a+c,a+d,a+e,b+c,b+d,b+e,c+d,c+e,d+e; so maximuum value will be d+e which is last element of array given

Re: [algogeeks] Re: intel puzzle

2011-02-24 Thread Vikas Kumar
@priyaranjan No,Your triangle will be right angle triangle. In fact any triangle chosen will be right angle triangle. Proof: suppose there are 2 planes kept at parallel with each other.(top bottom) join corresponding vertices of up to down and form cube. Now 3 points chosen can be on same

Re: [algogeeks] please help..

2011-02-24 Thread bharath kannan
a small modification in normal knapsack algo ll do :) On Thu, Feb 24, 2011 at 4:06 PM, Akshata Sharma akshatasharm...@gmail.comwrote: http://www.spoj.pl/problems/PIGBANK/ can anyone give me an idea how to solve this problem...?? I dont think the knapsack algo would be of help here as here we

[algogeeks] Re: intel puzzle

2011-02-24 Thread Dave
@Priyaranjan: Suppose that the cube has side 1 and is placed in standard position at the origin. Then the triangle with vertices (0,0,0), (1,0,1), and (1,1,0) is equilateral with side sqrt(2), and therefore is not a right triangle. Dave On Feb 24, 8:49 am, Vikas Kumar dev.vika...@gmail.com

[algogeeks] Re: Lets C Who Really Loves Perfect Square .................

2011-02-24 Thread Dave
@Ashish: The code seems pretty straightforward, but okay. The outer for-loop runs through the numbers that have 10-digit squares. The squares are represented as 64 bit integers (type long long) because some of them are larger than the maximum representable 32-bit integers. For each number, the

Re: [algogeeks]

2011-02-24 Thread sukhmeet singh
How do Levenshtein distance used.. For that u need to know the palindrome that is closest to it.. and if that is know than there is no point in calculating the distance .. we can easily see how many changes are to be made..!(correct me if I am wrong) Further my approach is this : taking the

[algogeeks] String of Max Length Which Repeats More Then Onep

2011-02-24 Thread bittu
Given a string (assume there no spaces or punctuations), write a program that returns the max. length of the string that has repeated more than once. Thanks Shashank -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

[algogeeks] Re: String of Max Length Which Repeats More Then Onep

2011-02-24 Thread Dave
@Bittu: Your statement of the problem doesn't make any sense. Apparently, you are given a string and somehow that string is repeated. Can you clarify it and give an example? Dave On Feb 24, 10:24 am, bittu shashank7andr...@gmail.com wrote: Given a string (assume there no spaces or

[algogeeks] OpenGL

2011-02-24 Thread punnu
hey guys... please tell me how to run OpenGl on eclipse. thanxx in advance.. -- 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] Re: amazon

2011-02-24 Thread nishaanth
Declare it as *static.* On Wed, Feb 23, 2011 at 11:33 PM, Jammy xujiayiy...@gmail.com wrote: Are you talking about IPC? On Feb 22, 10:05 am, jaladhi dave jaladhi.k.d...@gmail.com wrote: What do you mean by data element here ? Also by file you mean the file where you wrote the code ? And

[algogeeks] open cv

2011-02-24 Thread ankit sambyal
hey guys.. anyone working on implementing object tracking in open cv. please get back to me -- 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

[algogeeks] The segmentation of a text document

2011-02-24 Thread Glauben
Hello, Can you help me with tutorial about the segmentation of a text document ? I prefer the C + + but if it were in another language is no problem. Thank you very much. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group,

[algogeeks] Puzzle For Puzzled Minds -How Many Rounds..???

2011-02-24 Thread bittu
If you had 5,623 participants in a tournament, how many games would need to be played to determine the winner According to me if Tournament strategy is is used then i think its ok... After each round, you would have half the number that started the previous round; except if it were an odd

[algogeeks] In Place Merging of Two Sorted .Array...Not Easy as seems to be,....

2011-02-24 Thread bittu
we have two sorted array a[]={2,6,9,60}; b[]={1,3,5,34,80}; merge the array in such way.. a[]={1,2,3,5}; b[]={6,9,34,60,80}; ..no extra space is allowed..i.e. In-Place merging Many of you thinks its easy..but here is q. of minimum complexity i have done this but min e complexity high that not

[algogeeks] Construct Binary Tree From Ancestor Matrix

2011-02-24 Thread bittu
Given an ancestor matrix for an binary tree where a[i][j]=1 if i is parent to j, else a[i][j]=0 create the binary tree. from given ancestor matrix -- Algorithmor program or any approach will be appreciated Thanks Regards Shashank -- You received this message because you are subscribed to the

Re: [algogeeks]

2011-02-24 Thread Jammy
Using Dynamic programming. Divide array into two parts a and b. Run the minimum edit distance solution for each pair of (a,b)(except this time for b we need to start from the end of the array). Find the minimum among those. On Feb 24, 10:41 am, sukhmeet singh sukhmeet2...@gmail.com wrote: How

[algogeeks] Re: Puzzle For Puzzled Minds -How Many Rounds..???

2011-02-24 Thread Dave
Simpler. Every game eliminates one participant. Since 5,622 participants must be eliminated to have one winner, it takes 5,622 games. Dave On Feb 24, 5:43 pm, bittu shashank7andr...@gmail.com wrote: If you had 5,623 participants in a tournament, how many games would need to be played to

[algogeeks] Re: intel puzzle

2011-02-24 Thread awesomeandroid
@dave i never said it will be a right angled triangle ,it will be a equilateral triangle and thus an acute angled triangle. On Feb 24, 8:38 pm, Dave dave_and_da...@juno.com wrote: @Priyaranjan: Suppose that the cube has side 1 and is placed in standard position at the origin. Then the triangle

[algogeeks] Re: intel puzzle

2011-02-24 Thread awesomeandroid
@vikash kumar please read my answer then give your comment..it will be a equilateral triangle and not a right angled triangle i.e an acute angled triangle. On Feb 24, 7:49 pm, Vikas Kumar dev.vika...@gmail.com wrote: @priyaranjan No,Your triangle will be right angle triangle. In fact any

[algogeeks] Re: Antipodal points

2011-02-24 Thread Gene
Dave's solution is best if numerical error is possible. If the points are precise, you can also do it in linear time. Just hash the points on abs(y/x). -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] Re: intel puzzle

2011-02-24 Thread Dave
@Priyaranjan. Right. I should have directed my comment to Vikas. Sorry. Dave On Feb 24, 9:35 pm, awesomeandroid priyaranjan@gmail.com wrote: @dave i never said it will be a right angled triangle ,it will be a equilateral triangle and thus an acute angled triangle. On Feb 24, 8:38 pm,

[algogeeks] Re: intel puzzle

2011-02-24 Thread Dave
@Vikas: Suppose that the cube has side 1 and is placed in standard position at the origin. Then the triangle with vertices (0,0,0), (1,0,1), and (1,1,0) is equilateral with side sqrt(2), and therefore is not a right triangle. Dave On Feb 24, 8:49 am, Vikas Kumar dev.vika...@gmail.com wrote: