[algogeeks] standard puzzle

2012-06-10 Thread HARSHIT PAHUJA
There are 10 coins in a bag. 3 coin weights x kg 3 coins weights y kg 2 coins weights z kg 2 coins weights w kg You have to separate them into separate heaps according to their weights. -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] standard puzzle

2012-06-10 Thread HARSHIT PAHUJA
u have to separate them into 4 heaps in min number of comparisons . given a weighing balance On Sun, Jun 10, 2012 at 12:05 PM, Saurabh Yadav saurabh...@gmail.comwrote: question is incomplete , mention the conditions please On Sun, Jun 10, 2012 at 11:44 AM, HARSHIT PAHUJA hpahuja.mn

[algogeeks] override struct definition in c ????

2012-06-08 Thread HARSHIT PAHUJA
anyways to override this error , like in c++ or c# we use virtual keyword -- HARSHIT PAHUJA M.N.N.I.T. ALLAHABAD -- 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

[algogeeks] Microsoft interview question

2012-05-19 Thread HARSHIT PAHUJA
given 2 unsorted integer arrays a and b of equal size. Determine if b is a permutation of a. Can this be done in O(n) time and O(1) space ? please help me with my solution suppose a -- 3 5 4 b -- 4 3 5 now we replace a[i] with a[i]..th prime number and b with b[i] .. th

Re: [algogeeks] Microsoft interview question

2012-05-19 Thread HARSHIT PAHUJA
@malay --- we can do it by precomputing the prime arrays On Sun, May 20, 2012 at 1:10 AM, malay chakrabarti m1234...@gmail.comwrote: method is ryt but to find ith prime u cannot to it in constant time. On May 19, 2012 7:30 PM, HARSHIT PAHUJA hpahuja.mn...@gmail.com

Re: [algogeeks] Re: Check if one tree is sub tree of other

2012-03-20 Thread HARSHIT PAHUJA
, 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. -- HARSHIT PAHUJA M.N.N.I.T. ALLAHABAD -- You received this message because

[algogeeks] c output ??

2012-01-08 Thread HARSHIT PAHUJA
*#includestdio.h int main() { float f=25.25; printf(%d\n,f); long int x=90; printf(%f,x); return 0; } * above program gives output *0 25.25* shudn it be : *25 90.* ?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this

Re: [algogeeks] Re: POWER CRISES :Spoj

2011-06-30 Thread harshit pahuja
at 1:13 AM, harshit pahuja hpahuja.mn...@gmail.com wrote: http://en.wikipedia.org/wiki/Josephus_problem here there is an explanation of the derivation of josephus which is nt very clearcan some1 explain it plzz On Wed, Jun 29, 2011 at 12:40 PM, harshit pahuja hpahuja.mn

[algogeeks] POWER CRISES :Spoj

2011-06-29 Thread harshit pahuja
nd dp...* * * nw in its variant which is the spoj problem we have to kill evert kth person but we have to start by killing 1st den (k+1)th den(2k+1)th so on i m nt able to modify the above problem plzz help -- HARSHIT PAHUJA M.N.N.I.T. ALLAHABAD -- You received this message because

[algogeeks] Re: POWER CRISES :Spoj

2011-06-29 Thread harshit pahuja
http://en.wikipedia.org/wiki/Josephus_problem here there is an explanation of the derivation of josephus which is nt very clearcan some1 explain it plzz On Wed, Jun 29, 2011 at 12:40 PM, harshit pahuja hpahuja.mn...@gmail.comwrote: Hello guys... http://www.spoj.pl/problems/POCRI

Re: [algogeeks] Re: spoj shlights

2011-06-27 Thread harshit pahuja
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. -- HARSHIT PAHUJA M.N.N.I.T. ALLAHABAD -- You received this message because you

Re: [algogeeks] Re: puzzle

2011-06-26 Thread harshit pahuja
hw u r gettin 3 i m gettin 4 mine is make 4 grups 1,2,6 no 1 2,3,5 no 2 1,3,4 no 3 4,5,6no 4 nw out of 4 2 mice will die,and in their corresponding groups common bottle will give you the answer. correct me if i am wrong -- You received this message

Re: [algogeeks] Re: puzzle

2011-06-26 Thread harshit pahuja
i got it :) nice @dev!! -- 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 options,

[algogeeks] output plzz

2011-06-25 Thread harshit pahuja
#includestdio.h #define TOTAL_ELEMENTS (sizeof(array) / sizeof(array[0])) int array[] = {23,34,12,17,204,99,16}; int main() { int d; for(d=-1;d = (TOTAL_ELEMENTS-2);d++) printf(%d\n,array[d+1]); return 0; } y der is nothing in the output . - Regards - HARSHIT PAHUJA -- You received

[algogeeks] Segmentation fault

2011-06-23 Thread harshit pahuja
this is ma code for http://www.spoj.pl/problems/ANARC08H/musical chairs i m using dynamic programming for input lik 20 20 i m getting seg. fault plz tell hw to modify my program #includeiostream #includecstdio using namespace std; long long arr[10003][10003]; long long f(int

Re: [algogeeks] Segmentation fault

2011-06-23 Thread harshit pahuja
@piyush using array is mecessary as constraints are n,d100 so recursion cannot go to that much depth as we have stack limits what do u suggest -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] Segmentation fault

2011-06-23 Thread harshit pahuja
got it :) AC used single array nd got the job done.. On Thu, Jun 23, 2011 at 4:22 AM, harshit pahuja hpahuja.mn...@gmail.comwrote: @piyush using array is mecessary as constraints are n,d100 so recursion cannot go to that much depth as we have stack limits what do u

Re: [algogeeks] c doubt again

2011-06-23 Thread harshit pahuja
options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- HARSHIT PAHUJA M.N.N.I.T. ALLAHABAD -- 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 again

2011-06-23 Thread harshit pahuja
, 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. -- HARSHIT PAHUJA M.N.N.I.T. ALLAHABAD -- You received this message

Re: [algogeeks] Re: Segmentation fault

2011-06-23 Thread harshit pahuja
/group/algogeeks?hl=en. -- HARSHIT PAHUJA M.N.N.I.T. ALLAHABAD -- 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: If any one have algorithms for interviews by adnan aziz ebook... Please mail ...

2011-06-23 Thread harshit pahuja
this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- HARSHIT PAHUJA M.N.N.I.T. ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

Re: [algogeeks] c doubt again

2011-06-23 Thread harshit pahuja
...@gmail.comwrote: or u cud consult ANSI C by Balaguruswamy in chapter of Console I/Ps and O/Ps On 6/23/11, harshit pahuja hpahuja.mn...@gmail.com wrote: @rajeev http://www.cplusplus.com/reference/clibrary/cstdio/scanf/ http://www.cplusplus.com/reference/clibrary/cstdio/printf