[algogeeks] Re: NxN matrix

2007-11-27 Thread chandra kumar
Hi, If we are about to use an extra space this would be a better solution say the array is * # * * * * * *# X X X * *# X X X * *# X X X * ** * *Now in the above array use the fields containing *** to set the required columns to zero and *#* to set the

[algogeeks] help with this acm problem

2007-11-27 Thread Daniel Bastidas
Hi, I try to solve this problem: The ICPC world finals will be held in a luxurious hotel with a big ballroom. A buffet meal will be served in this ballroom, and organizers decided to decorate its walls with pictures of past champion teams. In order to avoid criticism about favouring some of

[algogeeks] Re: 1.X1 + 2.X2 + 3.X3 + ......+ K.Xk = K

2007-11-27 Thread Rupesh Bhochhibhoya
I have come up with the solution but still this is not the for the general case. I would like to make my problem clear once again. The problem is to find total number of solutions for the following expression. if k=1, the expression is like this: 1*x1=1, so number of solution is 1, i.e. x1=1.

[algogeeks] Re: 1.X1 + 2.X2 + 3.X3 + ......+ K.Xk = K

2007-11-27 Thread Dave
Hints: see http://www.research.att.com/~njas/sequences/A41, which relates the solution of your problem to the Partition Problem. Then see http://en.wikipedia.org/wiki/Partition_function_%28number_theory%29, which gives a recursion for calculating the Partition Function. Put the two together

[algogeeks] Re: 1.X1 + 2.X2 + 3.X3 + ......+ K.Xk = K

2007-11-27 Thread Rupesh Bhochhibhoya
Dave, this is not homework neither any class work. I am just trying to find whether there is any pattern in the number of solution for such expression, so that the solution can be expressed with general formula. BTW thanks for the link, seems to me my problem is much related to partition problem

[algogeeks] Excellent Microsoft question

2007-11-27 Thread John
Implement strstr(string, pattern, err) Where you want to find out whether the pattern occurs in string, allowing upto err number of errors in matching. Let ABC be the pattern to match, and let err be 1 Where an error is : a. omission : i.e. even AB should match b. replacement :

[algogeeks] Re: Excellent Microsoft question

2007-11-27 Thread Pradeep Muthukrishnan
google for edit distance problem and use costs for all operations to be 1, and if edit distance is err return true else false On Nov 27, 2007 10:56 PM, John [EMAIL PROTECTED] wrote: Implement strstr(string, pattern, err) Where you want to find out whether the pattern occurs in string,

[algogeeks] DP problem

2007-11-27 Thread John
Algorithm for finding out the longest palindrome in a given string using dynamic programming --~--~-~--~~~---~--~~ 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: DP problem

2007-11-27 Thread Pradeep Muthukrishnan
suppose arr[i][j] says if string from i to j is a palindrome then arr[i][j] = (str[i]==str[j]) arr[i+1][j-1] then answer = max (abs(i-j) such that arr[i][j] =1) On Nov 28, 2007 12:49 AM, John [EMAIL PROTECTED] wrote: Algorithm for finding out the longest palindrome in a given string