Re: [algogeeks] start of loop

2012-03-18 Thread Arunachalam
Two Pointers travelling at a different speed has to meet and this is the reason . Say the length of the loop is X. If we move both the pointers X times the fast moving pointer would have moved 2X location and the other one has moved only X locations. So 2X Pointer proceeds in advance over the other

Re: [algogeeks] Google written test

2012-03-18 Thread atul anand
@all : i guess question is on Fibonacci coding. here you can find the algo :- http://en.wikipedia.org/wiki/Fibonacci_coding On Sun, Mar 18, 2012 at 2:58 AM, Atul Singh wrote: > @Ravi... there should be only one answer as for fibonacci representation > of a number we have to include the part

Re: [algogeeks] Re: remove duplicates

2012-03-18 Thread shady
sorry, didn't get ? On Sun, Mar 18, 2012 at 11:19 PM, Siddhartha Banerjee < thefourrup...@gmail.com> wrote: > in a string... yes, because there are only 256 possible characters (or > 65536, in case of unicode), so just create a boolean array of length 256 > initialized to false and whenever a cha

Re: [algogeeks] Re: remove duplicates

2012-03-18 Thread Siddhartha Banerjee
in a string... yes, because there are only 256 possible characters (or 65536, in case of unicode), so just create a boolean array of length 256 initialized to false and whenever a character occurs make the corresponding element true. While scanning the string, if an element has already appeared, de

[algogeeks] Re: Math Question

2012-03-18 Thread Gene
I'm sorry there's an algebra error below, but fortunately the proof still works. It should be >From this, algebra provides 10^e - 1 == 0 (mod 9Y) and 10^e == 1 (mod 9Y). But 9Y and 10^e are still coprime, so we're good. Here is code that seems to be working fine. #include int main(int argc, c

Re: [algogeeks] Re: remove duplicates

2012-03-18 Thread shady
possible but with constraints on the range of the numbers On Sun, Mar 18, 2012 at 8:45 PM, rafi wrote: > i don't think it's possible (almost sure) > > On Mar 17, 3:41 pm, rahul sharma wrote: > > guys do we have algo to remove duplicates in o(n) time and in spce > > comepexity 0(1)...in unsorted

[algogeeks] Re: remove duplicates

2012-03-18 Thread rafi
i don't think it's possible (almost sure) On Mar 17, 3:41 pm, rahul sharma wrote: > guys do we have algo to remove duplicates in o(n) time and in spce > comepexity 0(1)...in unsorted...array  or string.??? -- You received this message because you are subscribed to the Google Groups "Algorithm

Re: [algogeeks] ITRIX'12 OPC

2012-03-18 Thread Prakash D
+1 On Fri, Mar 16, 2012 at 11:35 PM, shady wrote: > i wanted to try the questions now, but can't submit, can you provide the > problems, and testdata ? > > > On Mon, Mar 12, 2012 at 10:41 PM, Kashyap Krishnakumar > wrote: >> >> Hi, >>     The online programming contest of ITRIX, the national lev

Re: [algogeeks] Vertical Sum in a given Binary Tree

2012-03-18 Thread Supraja Jayakumar
Hi Others are also welcome to comment on the code. If links are allowed in algogeeks, I might send my wordpress blog link that explains this problem in detail and in picture. BinaryTree* VerticalSum(BinaryTree *bt) { if(!bt) return; BinaryTree *left = bt->left; BinaryTree *right = bt->right; bt->V

Re: [algogeeks] Vertical Sum in a given Binary Tree

2012-03-18 Thread rahul sharma
plz some one explain...i hav read online but getting the code and same explanaiton...need it urgent...thnx in advance On Sun, Mar 18, 2012 at 12:38 AM, rahul sharma wrote: > @anna..plz elaborate more... > > > On Sun, Mar 18, 2012 at 12:26 AM, Supraja Jayakumar < > suprajasank...@gmail.com> wrote: