Re: [algogeeks] problem tree minimum sum in binary

2011-07-26 Thread sunny agrawal
at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] size of self referential structure

2011-07-26 Thread sunny agrawal
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: Re : [algogeeks] Re: size of self referential structure

2011-07-26 Thread sunny agrawal
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 options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal

Re: [algogeeks] Re: SPOJ

2011-07-25 Thread sunny agrawal
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 options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B

Re: [algogeeks] Poison River

2011-07-25 Thread sunny agrawal
options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] output plzz

2011-07-24 Thread sunny agrawal
to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You

Re: [algogeeks] output plzz

2011-07-24 Thread sunny agrawal
Can't say but that seems to be the issue to me To get the final answer need to explore Stack contents. On Sun, Jul 24, 2011 at 12:34 PM, shady sinv...@gmail.com wrote: @sunny it should have printed some garbage after 'charlie' in that case ? that is what happens with scanf when you overwrite

Re: [algogeeks] Coding..........

2011-07-22 Thread sunny agrawal
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Coding..........

2011-07-22 Thread sunny agrawal
left to it are even and right odd.Its an implementation of quick sort as discussed earlier.Its o(n) no doubt but its not stable. On Fri, Jul 22, 2011 at 11:51 AM, sunny agrawal sunny816.i...@gmail.comwrote: @atul Your algo is not stable http://www.ideone.com/DrV5J BTW what are u trying

Re: [algogeeks] Coding..........

2011-07-22 Thread sunny agrawal
the ODD1 and EVEN2 result will be (2,4,1,3) On Fri, Jul 22, 2011 at 12:36 PM, Puneet Gautam puneet.nsi...@gmail.comwrote: @sunny: how do u do it by Divide n conquer ...can u provide the algo...? On 7/22/11, UMESH KUMAR kumar.umesh...@gmail.com wrote: Anybody try for maintain the stable

Re: [algogeeks] Re: Shooters in a circle

2011-07-22 Thread sunny agrawal
. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you

Re: [algogeeks] subwords in a given word!

2011-07-22 Thread sunny agrawal
=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] Interview Puzzle - 100 Prisoners and Caps

2011-07-22 Thread sunny agrawal
@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received

Re: [algogeeks] Sorting in O(n)

2011-07-22 Thread sunny agrawal
options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] Re: Coding Ques..............

2011-07-21 Thread sunny agrawal
, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee

Re: [algogeeks] Coding..........

2011-07-21 Thread sunny agrawal
. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you

Re: [algogeeks] Negative index of array

2011-07-20 Thread sunny agrawal
. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you

Re: [algogeeks] Re: C output

2011-07-20 Thread sunny agrawal
, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google

Re: [algogeeks] Re: Output

2011-07-20 Thread sunny agrawal
, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] Re: Find the missing number - Again given 4 billion integers

2011-07-18 Thread sunny agrawal
/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] Find the Row ..

2011-07-18 Thread sunny agrawal
://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] Find the Row ..

2011-07-18 Thread sunny agrawal
solution below O(n^2) On Mon, Jul 18, 2011 at 10:01 PM, sunny agrawal sunny816.i...@gmail.comwrote: if i am not getting question wrong. read only 3 rows find min and max of these 3n numbers as min and max will be only in one lines output the line without min and max On Mon, Jul 18

Re: [algogeeks] Find the Row ..

2011-07-18 Thread sunny agrawal
. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed

Re: [algogeeks] Output

2011-07-18 Thread sunny agrawal
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] static vs dynamic array

2011-07-18 Thread sunny agrawal
://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] Re: MICROSOFT

2011-07-18 Thread sunny agrawal
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 options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B

Re: [algogeeks] Re: Ever growing sorted linked list

2011-07-18 Thread sunny agrawal
@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message

Re: [algogeeks] Re: Dynamic Programming Cormen

2011-07-16 Thread sunny agrawal
to the problem -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] X-AmazoN

2011-07-15 Thread sunny agrawal
this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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: [algogeeks] c doubt

2011-07-13 Thread sunny agrawal
, Jul 11, 2011 at 5:54 PM, Piyush Kapoor pkjee2...@gmail.comwrote: Can anybody give a full explanation http://ideone.com/K1QmV On Sat, Jul 9, 2011 at 10:49 PM, sunny agrawal sunny816.i...@gmail.com wrote: try to find out the binary representation of float value 5.2 On Sat, Jul 9, 2011

Re: [algogeeks] c doubt

2011-07-13 Thread Sunny T
study terms like endian ,it is a pity i had to google it :( :( On Wed, Jul 13, 2011 at 10:30 PM, Anika Jain anika.jai...@gmail.comwrote: ya thts ryt, for big endian it will be 64 -90 102 102 On Wed, Jul 13, 2011 at 10:22 PM, sunny agrawal sunny816.i...@gmail.comwrote: I think

Re: [algogeeks] plz explain if the solution is possible with less than 2n-3 comparisons??

2011-07-13 Thread sunny agrawal
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] # References !!!!

2011-07-12 Thread sunny agrawal
Once a reference is initialized to an object, it cannot be changed to refer to another object. Ref. Bruce Eckel - ch11 So its Not possible -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] microsoft ques

2011-07-12 Thread sunny agrawal
. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] microsoft ques

2011-07-12 Thread sunny agrawal
PM, shilpa gupta shilpagupta...@gmail.comwrote: i think there is no need of this part else if(c== '}' ) { depth-=1; } than there is no need to find out max also depth will give max itself i think... On Tue, Jul 12, 2011 at 6:32 PM, sunny agrawal sunny816.i

Re: [algogeeks] microsoft ques

2011-07-12 Thread sunny agrawal
@shilpa see some post is hidden click on hide quoted text to see the complete post On Tue, Jul 12, 2011 at 6:46 PM, shilpa gupta shilpagupta...@gmail.comwrote: @sunny well this case is not possible i think in any code a braces that are opened should be closed...also On Tue, Jul 12

Re: [algogeeks] Search node in a binary tree

2011-07-12 Thread sunny agrawal
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 options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI

Re: [algogeeks] Max Arithmetic Subsequence

2011-07-12 Thread sunny agrawal
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Re: GOOGLE Q1

2011-07-11 Thread sunny agrawal
://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] sbtration

2011-07-11 Thread Sunny T
://groups.google.com/group/algogeeks?hl=en. -- Warm Regards, Sunny T -- 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

Re: [algogeeks] Re: sbtration

2011-07-11 Thread Sunny T
://groups.google.com/group/algogeeks?hl=en. -- Warm Regards, Sunny T -- 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

Re: [algogeeks] A Tough Bit Manipulation

2011-07-10 Thread Sunny T
options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Warm Regards, Sunny T -- 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

Re: [algogeeks] A Tough Bit Manipulation

2011-07-10 Thread Sunny T
=en. -- Warm Regards, Sunny T -- 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] A Tough Bit Manipulation

2011-07-10 Thread sunny agrawal
Smallest Number with k bits set will be the number with least significant k bits set ie. K=3 000111 K=4 000 and to find nth we can use thishttp://groups.google.com/group/algogeeks/msg/2b64c4f96fa3598e TC: O(n) On Sun, Jul 10, 2011 at 2:13 PM, Sunny T sunny.1...@gmail.com wrote

Re: [algogeeks] A Tough Bit Manipulation

2011-07-10 Thread Sunny T
thanks sunny On Sun, Jul 10, 2011 at 2:19 PM, sunny agrawal sunny816.i...@gmail.comwrote: Smallest Number with k bits set will be the number with least significant k bits set ie. K=3 000111 K=4 000 and to find nth we can use thishttp://groups.google.com/group/algogeeks

Re: [algogeeks] GOOGLE Q1

2011-07-10 Thread sunny agrawal
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 options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV

Re: [algogeeks] GOOGLE Q1

2011-07-10 Thread sunny agrawal
Longest AP for that Example is of 7 elements 2,4,6,8,10,12,14 now see your mistake ... as i have already told you that u r looking for only contiguous AP's and that won't work On Sun, Jul 10, 2011 at 7:18 PM, Yogesh Yadav medu...@gmail.com wrote: @sunny: my algo will give 6

Re: [algogeeks] Largest BST subtree in Binary Tree

2011-07-10 Thread sunny agrawal
at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] Largest BST subtree in Binary Tree

2011-07-10 Thread sunny agrawal
. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] GOOGLE Q1

2011-07-10 Thread sunny agrawal
that LAP[i,j] is essentially the same as LAP[0, j] by principle of optimality as the result needs to be calculated with start index 0). @Sunny: Any bugs in the analysis? -- DK http://twitter.com/divyekapoor http://www.divye.in -- You received this message because you are subscribed

Re: [algogeeks] Re: GOOGLE Q

2011-07-10 Thread sunny agrawal
O(N) algorithm. Descending order printing of pairs. @Sunny: Your time complexity is O(N^2) as creating that array will take O(N^2) time. @Dumanshu: Your algorithm misses cases. Eg. (9,4) will be printed but (9,3) will not. -- DK http://twitter.com/divyekapoor http://www.divye.in

Re: [algogeeks] Re: GOOGLE Q

2011-07-10 Thread sunny agrawal
A = 0 1 4 5 9 11 20 B = 0 2 3 6 8 13 15 (20, 15) (20, 15) - (20,15) (20,13) (11,15) - (20,13) (20,8) (11,15) - (20,8) (20,6) (11,15) - assume (20,6) (20,3) (11,15) - (11,15) (20,3) (9,15)- On Mon, Jul 11, 2011 at 1:06 AM, sunny agrawal sunny816.i...@gmail.comwrote

Re: [algogeeks] Re: GOOGLE Q

2011-07-10 Thread sunny agrawal
value but did i missed something ?? -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] Re: Interview question

2011-07-09 Thread sunny agrawal
at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] c doubt

2011-07-09 Thread sunny agrawal
://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] GOOGLE Q

2011-07-09 Thread sunny agrawal
to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute

Re: [algogeeks] Improve upon O(m^2)

2011-07-08 Thread sunny agrawal
. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] GOOGLE Q1

2011-07-08 Thread sunny agrawal
, Piyush Sinha ecstasy.piy...@gmail.comwrote: Nopesits about finding subsequence On 7/8/11, rajeev bharshetty rajeevr...@gmail.com wrote: Should the sequence beContinuos ??? On Fri, Jul 8, 2011 at 1:18 AM, sunny agrawal sunny816.i...@gmail.comwrote: @rajiv if Count = 2 means 3

Re: [algogeeks] Re: Amazon

2011-07-07 Thread sunny agrawal
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 options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV

Re: [algogeeks] puzzle

2011-07-07 Thread sunny agrawal
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 options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian

Re: [algogeeks] GOOGLE Q1

2011-07-07 Thread sunny agrawal
this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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: [algogeeks] GOOGLE Q1

2011-07-07 Thread sunny agrawal
@rajiv if Count = 2 means 3 elements isn't it a,a+d,a+2d else according to you for case 10 12 14 24 26 28 diff 2 2 10 2 2 diff 2 has count 4 so will you say ap of 4 elements with diff 2 On Fri, Jul 8, 2011 at 1:06 AM, rajeev bharshetty rajeevr...@gmail.comwrote: @sunny Keep count

Re: [algogeeks] Merging Sorted Arrays

2011-07-07 Thread sunny agrawal
, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google

Re: [algogeeks] GOOGLE Q3

2011-07-07 Thread sunny agrawal
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 options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year

Re: [algogeeks] Improve upon O(m^2)

2011-07-07 Thread sunny agrawal
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] GOOGLE Q3

2011-07-07 Thread sunny agrawal
http://ideone.com/xv73J On Fri, Jul 8, 2011 at 2:16 AM, Piyush Sinha ecstasy.piy...@gmail.comwrote: @Sunny...can u post a definite algo for it?? On 7/8/11, Ravi Shukla shuklaravi...@gmail.com wrote: @sunny , yep it looks DP. more of MCM. solve for substrings of length 1,2,3

Re: [algogeeks] GOOGLE Q3

2011-07-07 Thread sunny agrawal
...@gmail.comwrote: Can u explain ur algo too?? On 7/8/11, Piyush Sinha ecstasy.piy...@gmail.com wrote: @Sunny...nice solution but ur solution works if there can 1 to 3 groups of digits..but in the question its mentioned the group should contain exactly 2 or 3 digits... but anyways nice

Re: [algogeeks] Improve upon O(m^2)

2011-07-07 Thread sunny agrawal
i = m-1 j = m-1 k = 2m-1 *compare (i,j) and put the maximum at k if (i is max) decrement i; if (j is max) decrement j decrement k * and take care of boundary cases as well On Fri, Jul 8, 2011 at 10:55 AM, ankit sambyal ankitsamb...@gmail.comwrote: @Sunny : Plz can u expain ur approach

Re: [algogeeks] Sort - Consecutive Array in O(n)

2011-07-06 Thread sunny agrawal
/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] Random Number Generator

2011-07-06 Thread sunny agrawal
at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] Random Number Generator

2011-07-06 Thread sunny agrawal
Oops ... my method will also not work as probabilities will not be equal !!! On Wed, Jul 6, 2011 at 11:29 PM, sunny agrawal sunny816.i...@gmail.comwrote: For RNG in range [a,b] first thing is that all numbers should be generated with equal probability. in your case you are considering mid

Re: [algogeeks] Re: Interview Question

2011-07-05 Thread sunny agrawal
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 options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny

Re: [algogeeks] linked list

2011-07-04 Thread sunny agrawal
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group

Re: [algogeeks] Flatten a BST to produce inorder traversal

2011-07-04 Thread sunny agrawal
to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You

Re: [algogeeks] Implementing QUEUE with Singly link list

2011-07-04 Thread sunny agrawal
://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] Re: Interview Question

2011-07-03 Thread sunny agrawal
to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received

Re: [algogeeks] Optimisation to reduce time...

2011-07-03 Thread sunny agrawal
to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute

Re: [algogeeks] Re: Interview Question

2011-07-03 Thread sunny agrawal
) Regards, Sandeep Jain On Sun, Jul 3, 2011 at 1:09 PM, sunny agrawal sunny816.i...@gmail.comwrote: @sandeep SET A - {0,3,4,7} SET B - {1,2,5,6} xor of all elements is zero sum of both the sets is same no of elements in both are same overall result : all Algorithm posted above

Re: [algogeeks] Re: Number of Comparisons!

2011-07-03 Thread sunny agrawal
://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] Re: help..

2011-07-02 Thread sunny agrawal
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] Re: help..

2011-07-02 Thread sunny agrawal
. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] Re: help..

2011-07-02 Thread sunny agrawal
yes i have written that only difference between indexes of first set bit and last set bit On Sat, Jul 2, 2011 at 2:08 PM, cegprakash cegprak...@gmail.com wrote: whats mean by first set bit and last set bit? do you simply mean the index of first and last bit? On Jul 2, 1:25 pm, sunny agrawal

Re: [algogeeks] Re: help..

2011-07-02 Thread sunny agrawal
l = 81 0 0 0 k = 6 0 1 1 0 xor 1 1 1 0 difference = 2 l = 161 0 0 0 0 k = 4 0 0 1 0 0 xor On Sat, Jul 2, 2011 at 2:09 PM, sunny agrawal sunny816.i...@gmail.comwrote: yes i have written that only difference between indexes of first set bit

Re: [algogeeks] Re: help..

2011-07-02 Thread sunny agrawal
why ? On Sat, Jul 2, 2011 at 2:20 PM, cegprakash cegprak...@gmail.com wrote: @ sunny: so your's doesn't work right? -- 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

Re: [algogeeks] Re: help..

2011-07-02 Thread sunny agrawal
to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You

Re: [algogeeks] Re: help..

2011-07-02 Thread sunny agrawal
try out with examples!! u will surely get in 2-3 examples N(N-1) is a very famous expression, used in counting set bits. see what this expression return On Sat, Jul 2, 2011 at 2:51 PM, cegprakash cegprak...@gmail.com wrote: btw what N = N-(N(N-1)) does actually On Jul 2, 2:11 pm, sunny

Re: [algogeeks] Re: help..

2011-07-02 Thread sunny agrawal
options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] please explain

2011-07-01 Thread sunny agrawal
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group

Re: [algogeeks] Longest substring 0's 1's

2011-07-01 Thread sunny agrawal
this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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: [algogeeks] RMQ doubt.

2011-07-01 Thread sunny agrawal
=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] Longest substring 0's 1's

2011-07-01 Thread sunny agrawal
the difference between all maxIdx and minIdx if maxIdx is not -1 On Fri, Jul 1, 2011 at 5:34 PM, abc abc may.i.answ...@gmail.com wrote: @sunny very nice solution . can you write the code for hashing part On Fri, Jul 1, 2011 at 5:07 PM, Anantha Krishnan ananthakrishnan@gmail.com wrote

Re: [algogeeks] Re: Longest substring 0's 1's

2011-07-01 Thread sunny agrawal
yes but for largest interval we need only one index :) greater of i or j On Fri, Jul 1, 2011 at 6:01 PM, Dumanshu duman...@gmail.com wrote: @sunny: if a[i]==0 then 0,i is the solution suppose a[i]==a[j] ==0 now 0,i and 0,j is the solution. is i,j also the solution?? On Jul 1, 4:08 pm, sunny

Re: [algogeeks] Longest substring 0's 1's

2011-07-01 Thread sunny agrawal
or in other words equal no of 0's and 1's On Sat, Jul 2, 2011 at 12:42 AM, Anika Jain anika.jai...@gmail.com wrote: @sunny: in a[2,4] has 2 1s and one 0 then how is it a solution? i mean i didnt get wen a[i]==a[j] then a[i,j] is a solution case.. On Fri, Jul 1, 2011 at 4:13 PM, sunny agrawal

Re: [algogeeks] Re: given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-07-01 Thread sunny agrawal
from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed

Re: [algogeeks] Re: Constructing a Binary Search Tree from Post Order traversal-Possible or not

2011-06-30 Thread sunny agrawal
. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

Re: [algogeeks] Another spoj problem

2011-06-30 Thread sunny agrawal
. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you

Re: [algogeeks] query

2011-06-29 Thread sunny agrawal
, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] query

2011-06-29 Thread sunny agrawal
the error is in quotes, just rewrite them On Wed, Jun 29, 2011 at 5:24 PM, Anika Jain anika.jai...@gmail.com wrote: hey, printf(%d ya %u in both same error cming.. On Wed, Jun 29, 2011 at 5:10 PM, sunny agrawal sunny816.i...@gmail.comwrote: Because u copied the code i think :P try

Re: [algogeeks] linked list

2011-06-29 Thread sunny agrawal
this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- You received this message because you are subscribed to the Google

Re: [algogeeks] BST

2011-06-29 Thread sunny agrawal
/group/algogeeks?hl=en. -- Sunny Aggrawal B-Tech IV year,CSI Indian Institute Of Technology,Roorkee -- 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

<    1   2   3   4   >