[algogeeks] Re:

2009-08-15 Thread santhosh venkat
number of eggs On Sat, Aug 15, 2009 at 8:51 PM, sharad kumar wrote: > > can u use a game tree > http://en.wikipedia.org/wiki/Game_tree > > On Sat, Aug 15, 2009 at 8:49 PM, santhosh venkat < > santhoshvenkat1...@gmail.com> wrote: > >> @ Sharad >> I think the

[algogeeks] Re:

2009-08-15 Thread santhosh venkat
@ Sharad I think the replier's logic and explanation for the same can be found here . http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=algorithmGames Besides i think dp can also be applied here .but it needs lot of memory Santhosh . On Sat, Aug 15, 2009 at 8:42 PM, sharad kumar wrote:

[algogeeks] Re: Check divisibility by 3

2009-08-14 Thread santhosh venkat
ggarwal < >>>> yogesh.aggarwa...@gmail.com> wrote: >>>> >>>>> (CORRECTED ALGO.) >>>>> We can do like dis... >>>>> - add all d digits of the no. >>>>> - if the result is MORE than 10, add all the digits of the re

[algogeeks] Re: Check divisibility by 3

2009-08-14 Thread santhosh venkat
given a number n u can get the quotient when it is divided by 4 using right shift 2 times like n >> 2 this ll give u quotient(q) u can get the remainder by subtracting 4 * q from n which will give the remainder when divided by 4 by doing this u ll express n as n = 4q + r = 3q + (q+r) in this al

[algogeeks] Re: Finding repeated element in most efficient way

2009-08-09 Thread santhosh venkat
http://en.wikipedia.org/wiki/Pigeonhole_sortI think it was the repliers intention. But i think it is not the most optimal way of solving the question as the amount of memory it needs in the worst case is higher On Sun, Aug 9, 2009 at 1:47 PM, richa gup