Re: [algogeeks] Improve data store for this particular Code Chef problem to improve performance in time

2013-07-09 Thread Tian Guo
Can you just briefly describe your algorithm and time complexity? Then we could know the problem and think about from which perspective to improve it. Thx! 2013/7/9 abhishek sharma abhishek.p...@gmail.com Given *N* integers *A1, A2, AN*, Dexter wants to know how many ways he can

Re: [algogeeks] stack. Mid element in o(1)

2013-05-23 Thread Tian Guo
Using two stacks to simulate the getmiddle behavior. Amortized analysis can show each geimiddle is O(1) time complexity. Best, 2013/5/23 Prateek Jain prateek10011...@gmail.com I think there is no need for such a complex code. use length() method to get the size of the stack and return the

Re: [algogeeks] SPOJ- MPILOT WA on 10th TEST FILE

2013-05-12 Thread Tian Guo
Could you post the test case you failed? Then we can have a check. 2013/5/12 Piyush Raman piyush2011...@gmail.com I have been trying to solve this problem using DP. i managed to realize the problem in the form of recurrence.. The solution is: Suppose the task was : given N pilots you have

Re: [algogeeks] SPOJ- MPILOT WA on 10th TEST FILE

2013-05-12 Thread Tian Guo
the link of the problem statement: http://www.spoj.com/problems/MPILOT/ On Mon, May 13, 2013 at 1:36 AM, Tian Guo tian@epfl.ch wrote: Could you post the test case you failed? Then we can have a check. 2013/5/12 Piyush Raman piyush2011...@gmail.com I have been trying to solve this problem

Re: [algogeeks] Balanced Partitioning of Subsets

2012-11-20 Thread Tian Guo
a set of numbers into two subsets such that their difference is minimum (Balanced Partitioning Problem). Can anyone explain the suggested solution ? http://ace.delos.com/TESTDATA/JAN11.divgold.htm -- -- Best Regards, Tian Guo -- Tian Guo Assistant, Ph.D. Student Swiss Federal Institute