Re: [algogeeks] Mentor Graphics Help !!
i also want to know abt the off campus recruitment of mentor graphics On Mon, Aug 22, 2011 at 6:49 PM, Decipher ankurseth...@gmail.com wrote: Can anyone tell me the interview procedure of Mentor Graphics along with some interview questions ?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/NiJZzcypKH0J. 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. -- SOURABH JAKHAR,(CSE)(Final year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] networking for interviews
refer beej guide for networking programming and furozon for theory On Sun, Aug 14, 2011 at 2:42 AM, codeur kcrazy...@gmail.com wrote: hii we have not studied networking till now as a part of our curriculum (its in 8th sem) but companies coming for placement do ask questns based on networking. Can some body suggest some short tutorial which we can refer for answering such questns. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(Final year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: C Output
compiler dependent and will print some address On Sun, Aug 14, 2011 at 11:48 AM, sukran dhawan sukrandha...@gmail.comwrote: try out with Microsoft VC++ On Sun, Aug 14, 2011 at 11:47 AM, Brijesh Upadhyay brijeshupadhyay...@gmail.com wrote: I think i got it... STRING always return address of S , which then get summed with 1 and 2. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/kFrZUxzFTxsJ. 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. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(Final year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] mcq
b On Mon, Aug 8, 2011 at 4:18 PM, Kamakshii Aggarwal kamakshi...@gmail.comwrote: Which is not an advantage of using subroutines? (a) Easier maintenance (b) Runtime reduces (c) Storage space reduces (d) Modularity one of the answer is b. what about c? does subroutine reduce space? -- Regards, Kamakshi kamakshi...@gmail.com -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(Final year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] amazon
shell sort is the correct answer On Sun, Aug 7, 2011 at 11:09 PM, ankit sambyal ankitsamb...@gmail.comwrote: bubble sort -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(Final year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: latest google interview questions
@UTKARSH STRICT ACTION WILL BE TAKEN AGAINST U IN COLLEGE FOR SPAMMING THE GROUp On Wed, Aug 3, 2011 at 9:16 PM, rahul rahulr...@gmail.com wrote: Question 1: why output is hello. so printf is buffered function, as everyone knows who use linux/unix, every process open 3 file by default, and these are STDOUT, STDIN, STDERR, internally this program has STDOUT opened, and this hello is given to buffer in kernel thru write system call, and kernel driver write this to STDOUT, which is your console, that's the reason you get the output on console. Question 2: even a new born child knows. On Wed, Aug 3, 2011 at 9:09 PM, D!leep Gupta dileep.smil...@gmail.comwrote: @Admin: yup, Plz ban such type of users from this group. Dileep Kumar Computer Science Engineering -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(Final year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Microsoft Internship
abe dce se kitne leke gaye ms final year se aur package kya offer kiya On Tue, Aug 2, 2011 at 6:21 PM, Anurag atri anu.anurag@gmail.comwrote: you have to be in formals for sure ! yes , people who clear the written will have 3 interviews . On Tue, Aug 2, 2011 at 2:15 PM, saurabh modi saurabhmodi102...@gmail.comwrote: hey man,could you tell something abt the attire and all.? we dont need to go in formals,right? plus,koi interview and all hoga? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Anurag Atri III year Computer Engineering Delhi College Of Engineering -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(Final year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] MICROSOFT!!!!
study basic well they give a lot of emphasis on them On Mon, Jul 18, 2011 at 8:41 PM, SkRiPt KiDdIe anuragmsi...@gmail.comwrote: After 22nd plz post ur questions ... !! It wud be of great HelP. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(Final year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Microsoft Qn: Algo to find the border of a binary tree
hey today ms visited our campus they asked simple 10 c output in first round and than 45 minutes coding round one question on test case on notepad,design bigint class,one simple question on array. On Sun, Jul 17, 2011 at 3:42 PM, sagar pareek sagarpar...@gmail.com wrote: @reynaled :- Happy to help @Sameer :- Thanks for pointing out and i think all you guyz now can optimize it :) On Sun, Jul 17, 2011 at 11:35 AM, sameer.mut...@gmail.com sameer.mut...@gmail.com wrote: @sagar: The question says Algo should be in place. So use of an array to print the right border of tree is not advisable. We can do it recursively without using an array also . On Sat, Jul 16, 2011 at 10:48 PM, sameer.mut...@gmail.com sameer.mut...@gmail.com wrote: @sagar: There is one flaw in the code. Trace ur code 15 and 250 get printed twice. otherwise it is fine. On Sat, Jul 16, 2011 at 7:59 PM, sukhmeet singh sukhmeet2...@gmail.comwrote: please explain the code a bit more.. unable to understand it..an example will be better.. On Sun, Jul 17, 2011 at 7:10 AM, Reynald Suz reynaldsus...@gmail.comwrote: Yep! On Sun, Jul 17, 2011 at 1:02 AM, swetha rahul swetharahu...@gmail.com wrote: @Reynald Will 75 not be included in the tree that u have given..?? On Sun, Jul 17, 2011 at 12:49 AM, sagar pareek sagarpar...@gmail.com wrote: here is the code void border(node*); void recur(node*); void border(node *ptr) { node* tmp; int stack[20],top=0; if(tmp=ptr-left) { while(tmp-left) { printf(%d ,tmp-data); tmp=tmp-left; } } recur(ptr); if(tmp=ptr-right) { while(tmp-right) { stack[top++]=tmp-data; tmp=tmp-right; } } while(top--) printf(%d ,stack[top]); printf(%d\n,ptr-data); } void recur(node* ptr) { if(ptr-left) recur(ptr-left); if(!ptr-left!ptr-right) printf(%d ,ptr-data); if(ptr-right) recur(ptr-right); } On Sat, Jul 16, 2011 at 7:07 PM, Reynald reynaldsus...@gmail.comwrote: Algo to find the border of a given binary tree. Optimized for space and time. Input: 10 / \ 50 50 / \ / \ 25 75 20020 / \ / /\ 15 35 120155 250 Output:50 25 15 35 120 155 250 20 150 10 -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT 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...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Reynald Reni Masters in Software Engineering CIT - India -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT 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...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE
Re: [algogeeks] MICROSOFT
10 c output question . questions were moderate type but negative marking +3 and -2.(30 min) coding round.(45 min) 1.array simple question d.p 2.test cases of notepad 3.Design Big Int class in C or c++ On Sun, Jul 17, 2011 at 5:14 PM, Harshal hc4...@gmail.com wrote: @manish, can you please tell other questions asked by ms today? On Sun, Jul 17, 2011 at 4:53 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: It can be done using one extra array only that is the output array out[] *int out = (int *)malloc(sizeof(n)); //n is the number of elements in a int i,temp = 1; for(i=0;in;i++) { out[i] = temp; temp*=a[i]; } temp =1; for(i=n-1;i=0;i--) { out[i] *= temp; temp*=a[i]; }* On Sun, Jul 17, 2011 at 4:43 PM, manish patel manispatel...@gmail.comwrote: thanx the question was asked by MS today in MNNIT. On Sun, Jul 17, 2011 at 4:35 PM, Anurag Aggarwal anurag19aggar...@gmail.com wrote: take two extra arrays b[] and c[] in b[] store the following thing b[0]=1; b[i]=b[i-1]*a[i-1]; in c[] store following things c[n-1]=1; c[i]=c[i+1]*a[i+1] (in-1) fill the c[] array in reverse order i.e. start from n-1 then go to 0; now output[] would be output[i]=b[i]*c[i]; On Sun, Jul 17, 2011 at 4:28 PM, geek forgeek geekhori...@gmail.comwrote: given an array a[0..n-1] .required to find the output array out [0.n-1] such that out [i] is the product of all the numbers a[0] to a[n-1] excluding a[i] for ex out[2]=a[0]*a[1]*a[3]*a[4]a[n-1] constraint is not using division operator how to do this in O(n)?? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. Anurag Aggarwal -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- With Regards Manish Patel BTech 2nd Year Computer Science And Engineering National Institute of Technology -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...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Piyush Sinha* *IIIT, Allahabad* *+91-7483122727* * https://www.facebook.com/profile.php?id=10655377926 NEVER SAY NEVER * -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Best Regards, Harshal Choudhary 7th Semester, CSE Dept. NIT Surathkal, India. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] MICROSOFT
we can also use dynamically allocated array where they contain the digits of number and than apply the operation it is a better option i think as we can go to any index in 0(1) time. On Sun, Jul 17, 2011 at 5:19 PM, Harshal hc4...@gmail.com wrote: thanks sourabh :) On Sun, Jul 17, 2011 at 5:17 PM, sourabh jakhar sourabhjak...@gmail.comwrote: 10 c output question . questions were moderate type but negative marking +3 and -2.(30 min) coding round.(45 min) 1.array simple question d.p 2.test cases of notepad 3.Design Big Int class in C or c++ On Sun, Jul 17, 2011 at 5:14 PM, Harshal hc4...@gmail.com wrote: @manish, can you please tell other questions asked by ms today? On Sun, Jul 17, 2011 at 4:53 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: It can be done using one extra array only that is the output array out[] *int out = (int *)malloc(sizeof(n)); //n is the number of elements in a int i,temp = 1; for(i=0;in;i++) { out[i] = temp; temp*=a[i]; } temp =1; for(i=n-1;i=0;i--) { out[i] *= temp; temp*=a[i]; }* On Sun, Jul 17, 2011 at 4:43 PM, manish patel manispatel...@gmail.comwrote: thanx the question was asked by MS today in MNNIT. On Sun, Jul 17, 2011 at 4:35 PM, Anurag Aggarwal anurag19aggar...@gmail.com wrote: take two extra arrays b[] and c[] in b[] store the following thing b[0]=1; b[i]=b[i-1]*a[i-1]; in c[] store following things c[n-1]=1; c[i]=c[i+1]*a[i+1] (in-1) fill the c[] array in reverse order i.e. start from n-1 then go to 0; now output[] would be output[i]=b[i]*c[i]; On Sun, Jul 17, 2011 at 4:28 PM, geek forgeek geekhori...@gmail.comwrote: given an array a[0..n-1] .required to find the output array out [0.n-1] such that out [i] is the product of all the numbers a[0] to a[n-1] excluding a[i] for ex out[2]=a[0]*a[1]*a[3]*a[4]a[n-1] constraint is not using division operator how to do this in O(n)?? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. Anurag Aggarwal -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- With Regards Manish Patel BTech 2nd Year Computer Science And Engineering National Institute of Technology -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...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Piyush Sinha* *IIIT, Allahabad* *+91-7483122727* * https://www.facebook.com/profile.php?id=10655377926 NEVER SAY NEVER * -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Best Regards, Harshal Choudhary 7th Semester, CSE Dept. NIT Surathkal, India. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Best Regards, Harshal Choudhary 7th Semester, CSE Dept. NIT Surathkal, India. -- 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, visit
Re: [algogeeks] MICROSOFT
when we have + and - than we can also implement division as we do in assembly language subtract the divisor form dividend and keep track of remainder On Sun, Jul 17, 2011 at 5:34 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: @AnchalI think + - and * wont create much problemwe have to think for an efficient way for division -- *Piyush Sinha* *IIIT, Allahabad* *+91-7483122727* * https://www.facebook.com/profile.php?id=10655377926 NEVER SAY NEVER * -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(Final year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Given a BST containing integers, and a value K. You have to find two nodes that give sum = K.
convert into doubly linked list and than apply simple algo of finding two element with a sum On Sat, Jul 16, 2011 at 7:54 PM, saurabh singh saurab...@gmail.com wrote: Check https://groups.google.com/group/algogeeks/browse_thread/thread/e8735bcdbf4c956/c49018d0eac8070b?hl=enlnk=gstq=saurabh8c#c49018d0eac8070b On Sat, Jul 16, 2011 at 7:50 PM, noobcoder ase.as...@gmail.com wrote: Given a BST containing integers, and a value K. You have to find two nodes that give sum = K. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Saurabh Singh B.Tech (Computer Science) MNNIT 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...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: 2 D array(dynamic allocation)
://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: 2 D array(dynamic allocation)
#includestdio.h int main() { int i,j; int ct=0; int *a[3]; for( i=0;i3;i++) { a[i]=(int **)malloc(sizeof(int)*4); } for(i=0;i3;i++){ for(j=0;j4;j++) a[i][j]=ct++; printf(%d,a[i][j]); } On Sat, Jul 2, 2011 at 2:27 AM, sravanreddy001 sravanreddy...@gmail.comwrote: @saurabh.. No man.. it involves variable number of calls.. even if its present only once in code. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/2VonkRB6WMEJ. 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. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] novel written test
two On Tue, Jun 28, 2011 at 2:23 AM, amit the cool amitthecoo...@gmail.comwrote: A chain is broken into three pieces of equal lengths containing 3 links each. It is taken to a back smith to join into a single continuous one . How many links are to be opened to make it ? -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] c++ output
int main() { g(); f(); } inline int f(){ g(); return g()+1; } inline int g() { return 1; } this code works but if removed inline than gives run time error can any one explain -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] c output
#includestdio.h #includestdio.h #includeconio.h #define PRINTX printf(%d\n,x) main() { int x=2,y,z; x*=3 + 2; PRINTX; x*= y = z = 4; PRINTX; x = y == z; PRINTX; x == ( y = z ); PRINTX; getch(); } can anyone explain the output -- SOURABH JAKHAR,(CSE)(3 year) The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] c output
ok i got it is the precedence of *= is less than of + On Wed, May 25, 2011 at 3:52 PM, Shachindra A C sachindr...@gmail.comwrote: 1st print : x = x * (3 + 2) - 10 2nd print : x = x * 4 - 40 : while evaluating the expression, the rightmost result will be used 3rd print : x = (4 == 4) - 1 4th print : x == ( y = z ) evaluates to false; prev val of x, 1 is printed On Wed, May 25, 2011 at 3:35 PM, sourabh jakhar sourabhjak...@gmail.comwrote: #includestdio.h #includestdio.h #includeconio.h #define PRINTX printf(%d\n,x) main() { int x=2,y,z; x*=3 + 2; PRINTX; x*= y = z = 4; PRINTX; x = y == z; PRINTX; x == ( y = z ); PRINTX; getch(); } can anyone explain the output -- SOURABH JAKHAR,(CSE)(3 year) The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards, Shachindra A C -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] C OUTPUT
#includestdio.h void main() { long x; float t; scanf(%f,t); printf(%d\n,t); x=90; printf(%f\n,x); { x=1; printf(%f\n,x); { x=30; printf(%f\n,x); } printf(%f\n,x); } x==9; printf(%f\n,x); } CAN ANYBODY EXPLAIN THE OUTPUT -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] [brain teaser ] Is This Maths Riddle 19 may
10=3 because ten = three characters in it On Thu, May 19, 2011 at 1:51 PM, ps.raghuchan...@gmail.com ps.raghuchan...@gmail.com wrote: cuz 10=3 On Thu, May 19, 2011 at 12:57 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote: *Is This Maths Riddle * * *** * * ** *If 12=6 and 6=3 then why doesn't 10=5? (and what does 10 equal?) * [brain teaser ] Is This Maths Riddle 19 may *Update Your Answers at* : Click Herehttp://dailybrainteaser.blogspot.com/2011/05/is-this-maths-riddle-19-may.html?lavesh=lavesh Solution: Will be updated after 1 day -- Never explain yourself. Your friends don’t need it and your enemies won’t believe it . -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- P.S.Raghu Chandra, IIIT Allahabad, B.Tech 8th sem. ps.raghuchan...@gmail.com -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Efficient Way to Detect Duplicate Document
please elaborate On Wed, May 4, 2011 at 4:20 PM, Sathaiah Dontula don.sat...@gmail.comwrote: hash on the each page and compare the hash value. Thanks regards, Sathaiah Dontula On Tue, May 3, 2011 at 8:59 PM, bittu shashank7andr...@gmail.com wrote: suppose You have a billion urls, where each is a huge page. How do you detect the duplicate documents? on what criteria you will detect it, what algorithm , approach , whats will be the complexity of each approach as it has many application in computer science ...i would like to have some good discussion on this topic Lets Explohttp://www.facebook.com/rer All The Approach ??? Thanks Regrads Shashank CSE, BIT Mesra -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks]
You are given a large string. You need to cut the string into chunks such that each substring that you get is a palindrome. Remember that each 1 length string is always a palindrome. You need to find the minimum number of cuts that you need to make such that each substring is a palindrome. http://www.careercup.com/question?id=8972527 -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: LARGEST NUMBER PUZZLE 6 MAY
what about 9!pow9! On Fri, May 6, 2011 at 5:04 PM, RAghu ps.raghuchan...@gmail.com wrote: What about (9 pow 9) ! On May 6, 4:30 pm, uday kumar uda...@gmail.com wrote: 9 pow 9. On Fri, May 6, 2011 at 3:41 PM, Bala cmb...@gmail.com wrote: 99! Thanks Bala On Fri, May 6, 2011 at 2:48 PM, Lavesh Rawat lavesh.ra...@gmail.com wrote: * LARGEST NUMBER PUZZLE What is the largest number you can get using only 2 digits? Update Your Answers at : Click Here http://dailybrainteaser.blogspot.com/2011/05/largest-number-puzzle-6-... Solution: Will be updated after 1 day -- Never explain yourself. Your friends don’t need it and your enemies won’t believe it . * -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: LARGEST NUMBER PUZZLE 6 MAY
@manjeet you are genious go for google On Fri, May 6, 2011 at 5:09 PM, ps.raghuchan...@gmail.com ps.raghuchan...@gmail.com wrote: @manjeet ...heheheheheh On Fri, May 6, 2011 at 5:08 PM, Manjeet Chayel chayel.manj...@gmail.comwrote: 1/0 On Fri, May 6, 2011 at 5:06 PM, sourabh jakhar sourabhjak...@gmail.comwrote: what about 9!pow9! On Fri, May 6, 2011 at 5:04 PM, RAghu ps.raghuchan...@gmail.com wrote: What about (9 pow 9) ! On May 6, 4:30 pm, uday kumar uda...@gmail.com wrote: 9 pow 9. On Fri, May 6, 2011 at 3:41 PM, Bala cmb...@gmail.com wrote: 99! Thanks Bala On Fri, May 6, 2011 at 2:48 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote: * LARGEST NUMBER PUZZLE What is the largest number you can get using only 2 digits? Update Your Answers at : Click Here http://dailybrainteaser.blogspot.com/2011/05/largest-number-puzzle-6-.. . Solution: Will be updated after 1 day -- Never explain yourself. Your friends don’t need it and your enemies won’t believe it . * -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Cheers!! Manjeet Chayel -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- P.S.Raghu Chandra, IIIT Allahabad, B.Tech 8th sem. ps.raghuchan...@gmail.com -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] GOOGLE INTERVIEW QUESTION
On Fri, May 6, 2011 at 4:23 PM, sourabh jakhar sourabhjak...@gmail.comwrote: You are given a large string. You need to cut the string into chunks such that each substring that you get is a palindrome. Remember that each 1 length string is always a palindrome. You need to find the minimum number of cuts that you need to make such that each substring is a palindrome. http://www.careercup.com/question?id=8972527 -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks]
can you explain the logic On Fri, May 6, 2011 at 8:02 PM, abhijith reddy abhijith200...@gmail.comwrote: O(N^3) DP - char str[MAX]; int dp1[MAX][MAX],dp2[MAX][MAX]; int isPalin(int low,int high) { if(low=high) return 1; if(dp1[low][high]!=-1) return dp1[low][high]; return dp1[low][high]=(str[low]==str[high])?isPalin(low+1,high-1):0; } int minCuts(int low,int high) { if(isPalin(low,high)) return 0; if(dp2[low][high]!=-1) return dp2[low][high]; int ans=1e9; for(int i=low;ihigh;i++) ans=min(ans,1+minCuts(low,i)+minCuts(i+1,high)); return dp2[low][high]=ans; } - On Fri, May 6, 2011 at 4:23 PM, sourabh jakhar sourabhjak...@gmail.comwrote: You are given a large string. You need to cut the string into chunks such that each substring that you get is a palindrome. Remember that each 1 length string is always a palindrome. You need to find the minimum number of cuts that you need to make such that each substring is a palindrome. http://www.careercup.com/question?id=8972527 -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks]
- Given a white background with a black random shape scattering around. Describe and code an algorithm to count the number of black shapes. You can assume input to be an array of 3xMxN in RGB color space. 2 SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks]
You have a billion urls, where each has a huge page. How to you detect the duplicate documents? -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks]
come on geeks wake up On Thu, May 5, 2011 at 7:33 PM, sourabh jakhar sourabhjak...@gmail.comwrote: You have a billion urls, where each has a huge page. How to you detect the duplicate documents? -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: C o/p gud one try
these kind of question are compiler dependent if you are preparing for interview than these kind of questions are not asked On Tue, Mar 29, 2011 at 10:42 PM, kunal srivastav kunal.shrivas...@gmail.com wrote: refer let us c by YK fr these type of ques On Tue, Mar 29, 2011 at 10:07 PM, ArPiT BhAtNaGaR arpitbhatnagarm...@gmail.com wrote: please do answer geeks me waiting On Mon, Mar 28, 2011 at 11:14 PM, ArPiT BhAtNaGaR arpitbhatnagarm...@gmail.com wrote: #includestdio.h main() { long x; float t; scanf(%f,t); printf(%d\n,t); x=90; printf(%f\n,x); { x=1; printf(%f\n,x); { x=30; printf(%f\n,x); } printf(%f\n,x); } x==9; printf(%f\n,x); } o/p on gcc compiler 20.3 (i/p given) -1073741824 20.299988 20.299988 20.299988 20.299988 20.299988 plz explain the o/p -- Arpit Bhatnagar (MNIT JAIPUR) -- Arpit Bhatnagar (MNIT JAIPUR) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- thezeitgeistmovement.com -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] [brain teaser ] 29march
122 On Tue, Mar 29, 2011 at 6:51 PM, Carl Barton odysseus.ulys...@gmail.comwrote: Agreed, 122 On 29 March 2011 14:19, Kunal Yadav kunalyada...@gmail.com wrote: 122 1, 2, 5, 14, 41, x Whats x ?? -- Regards Kunal Yadav (http://algoritmus.in/) -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: 28march
answer is 6 races On Mon, Mar 28, 2011 at 11:53 PM, Dave dave_and_da...@juno.com wrote: 7 races. For the first five races, divide the horses into groups of five and record the win, place, and show finishers of each race. For the sixth race, run the winners of the first five races. Now, only six horses remain in contention for the fastest three: The winner of the sixth race and the place and show horses of his first race, The place horse in the sixth race and the place horse in his first race. The show horse in the sixth race. Three of these horses are known to be faster than all other horses. The winner of the sixth race is known to be the fastest horse. Run the other five contenders in race 7 and choose the fastest two. Dave On Mar 28, 2:54 am, Lavesh Rawat lavesh.ra...@gmail.com wrote: *Horse Race Problem Solution* * *Ok, so there are 25 horses and the race track only allows 5 horses to race at a given time. Given that there is no stop watch available your task is to determine the fastest 3 horses. Assume that each horses speed is constant in different races, what is the minimum number of races to determine the fastest 3? Update Your Answers at : Click Here http://dailybrainteaser.blogspot.com/2011/03/28march.html?lavesh=lavesh Solution: Will be updated after 1 day -- Never explain yourself. Your friends don’t need it and your enemies won’t believe it . -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: intel puzzle
the answer would be more than 8 an it is 32 i think. but i m sure it will be more than 8 On Wed, Feb 23, 2011 at 7:54 AM, Terence technic@gmail.com wrote: 8C3 - 12 * 4C3 = 8 Any 3 vertices out of a rectangle only form a right triangles. Then only 8 regular triangle left. (Cut out each of the 8 vertices) On 2011-2-23 3:10, jalaj jaiswal wrote: answer is 8 ,,, duno how On Wed, Feb 23, 2011 at 12:31 AM, Sundi sundi...@gmail.com wrote: Is it not 8C3 = 56 On Feb 22, 9:55 pm, jalaj jaiswal jalaj.jaiswa...@gmail.com wrote: Think of the 8 vertices of a given cube. You are allowed to join three vertices to form a triangle. How many such unique acute triangles can you make ?? -- With Regards, *Jalaj Jaiswal* (+919019947895) Software developer, Cisco Systems B.Tech IIIT 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...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- With Regards, *Jalaj Jaiswal* (+919019947895) Software developer, Cisco Systems B.Tech IIIT 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...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: C++ Riddle
jalaj is right actually the complier produce p[n]=*(p+n); On Mon, Feb 7, 2011 at 12:34 PM, Rajiv Podar rajeevpo...@gmail.com wrote: for e.g. u can use operator. int a = 1; a = a 1; a become 2; Or u cannot use any , |, ^ operations. Thanks Regards, Rajiv Podar On Mon, Feb 7, 2011 at 12:33 PM, jagannath prasad das jpdasi...@gmail.com wrote: bit operation means what? On Mon, Feb 7, 2011 at 12:00 PM, Rajiv Podar rajeevpo...@gmail.comwrote: @Dave: ++ and -- are arithmetic operations. @Jalaj: I agree with the above solution Thanks Regards, Rajiv Podar On Mon, Feb 7, 2011 at 11:47 AM, jalaj jaiswal jalaj.jaiswa...@gmail.com wrote: try this let nos be m n char * p; p=m; int sum = (int)p[n] ; sum is m+n :) On Mon, Feb 7, 2011 at 11:41 AM, Dave dave_and_da...@juno.com wrote: @Ricky: if increment and decrement operators are not considered arithmetic, try int sum(int m, int n) { while( m 0 ) { m--; n++; } while( m 0 ) { m++; n--; } return n; } On Feb 6, 11:49 pm, Ricky rajeevpo...@gmail.com wrote: write the program to add two numbers without using arithmetic and bit operation.. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- With Regards, *Jalaj Jaiswal* (+919019947895) Final Year Undergraduate, IIIT 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...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Puzzle to Puzzle you Part _ 1
he takes 10 card from the piles and reverse . so there are two piles 1. 42 2.10 there are 10 cases possible 1. out of 10 cards in second pile all are down in it and all up card are in other pile than you simply reverse the second pile. 2. out of 10 cards in second pile all are down except one which is up so there are 9 up cards in 1 pile so he simply reverses again the secon pile. this order continues On Thu, Feb 3, 2011 at 10:55 AM, Rajiv Podar rajeevpo...@gmail.com wrote: Hi Bhavesh, Blind man has to create two piles of his own so he dont know which pile have how much up face cards Thanks Regards, Rajiv Podar On Thu, Feb 3, 2011 at 10:42 AM, Bhavesh agrawal agr.bhav...@gmail.comwrote: IS FACING UP CARDS ARE RANDOMLY DISTRIBUTED IN THE PILE On Thu, Feb 3, 2011 at 9:02 AM, Ricky rajeevpo...@gmail.com wrote: Hi, I have come up with one interesting puzzle so I thought of discussing with you guys: A blind man is given deck of 52 cards with 10 card facing up and rest are facing down. He need to create two piles not necessarily of same height in order to have same number of up cards in both. I would publish the solution one I got some good replies.. BTW: I will publish some more puzzles once I found that members are liking these puzzles.. Thanks!! -- 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.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: minimum no. of clicks
this solution is wrong On Wed, Feb 2, 2011 at 12:41 AM, bittu shashank7andr...@gmail.com wrote: @ its again the question related to the frequency..of number My Approach would be we have to count the no. of time the a particular number occurring in the array then first took the number which has lowest frequency in case of Tie FCFS used up. then proceed to higher frequency number that represents the continuous chunks so that how much elements this chunks it has we can remove this in a single click so on so for this 3 1 2 1 4 3 1 2 1 4 3 2 here array of 4 elements Elements1 2 3 4 ///also lets say we are initializing the array index as 1 Index 1 2 3 4 Frequency 4 3 3 2 we first process the 4 Click Required 1 then 2 Click Required 1 then 3Click Required 1 then 1Click Required 1 Total Click Required =4 so It Can be done in O(n) while space O(n) is penalty we have to pay for it...more better approach will be appreciated Correct me if you Find Approach is wrongs Thanks Regrads Shashank Mani The best way to escape from a problem is to solve it. -- 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.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: google questions
in hash table we can implement the binary search to find the correct position of word to be inserted if it exist or not . On Wed, Feb 2, 2011 at 11:22 PM, Wei.QI qiw...@gmail.com wrote: This is a standard map reduce problem. 1. reduce the file by word: sending words into machines based on it's val. 2. count words, return top 10 words in each machine. 3. aggregate results together to get top 10. -weiq On Wed, Feb 2, 2011 at 8:46 AM, bittu shashank7andr...@gmail.com wrote: @sankalp ...You seems to be right also u told u like trie..so could u elaborate the approach given by you by giving some example algo or code.. although hastable/hashmap..is also alternative of such problem but wants to see your explanation about this question .because a problem can be solved by many ways but only best way so Explain with Example Thanks Shashank -- 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.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Sort string based upon the count of characters
we can use the count sort array in this to count the frequencies of character (array size would be fixed 26) and sort that counting array by again count sort or quick sort in decrsaing order and than print the valur in ascci format '97+i'. On Thu, Jan 13, 2011 at 11:53 AM, Davin dkthar...@googlemail.com wrote: Smaple Data : input : abcdacdc Output : cadb If the count is same for characters. maintain the original order of the characters from input string. Please do let me know for any clarification. -- 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.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] google paper/...plz help..its urgent
for second question answer is b On Thu, Jan 13, 2011 at 4:41 AM, Anand anandut2...@gmail.com wrote: On Wed, Jan 12, 2011 at 1:14 AM, snehal jain learner@gmail.comwrote: 1. Quick-sort is run on two inputs shown below to sort in ascending order (i) 1,2,3, ….,n (ii) n, n - 1, n - 2, …., 2, 1 Let C1 and C2 be the number of comparisons made for the inputs (i) and (ii) respectively. Then, a) C1 C2 b) C1 C2 c) C1 = C2 Answer is c http://codepad.org/8xpqfGwJ d) We cannot say anything for arbitrary n 2. Which of the following languages over {0, 1} is regular? a) 0i1j such that i ≤ j b) 0iw1j such that w ∈ {0, 1}∗ and i ≥ 0 c) All strings of 0s and 1s such that every pth character is 0 where p is prime d) None of the above 3. We are given a set X = {x1, x2, ..., xn} where xi = 2i. A sample S (which is a subset of X) is drawn by selecting each xi independently with probability pi = 1 / 2. The expected value of the smallest number in sample S is: a) 1 / n b) 2 c) sqrt(n) d) n 4. Let S be an NP-complete problem and Q and R be two other problems not known to be in NP. Q is polynomial time reducible to S and S is polynomial-time reducible to R. Which one of the following statements is true? a) R is NP-complete b) R is NP-hard c) Q is NP-complete d) Q is NP-hard 5. For any string s ∈ (0 + 1)*, let d(s) denote the decimal value of s (eg: d(101) = 5, d(011) = 3). Let L = {s ∈ (0+1)* | d(s) mod 5 = 2 and d(s) mod 7 = 4}. Which of the following statements is true? a) L is recursively enumerable, but not recursive b) L is is recursive, but not context-free c) L is context-free, but not regular d) L is regular Common data for questions 6 and 7 The 2n vertices of a graph G corresponds to all subsets of a set of size n. Two vertices of G are adjacent if and only if the corresponding sets intersect in exactly 2 elements 6. The number of vertices of degree zero in G is: a) 1 b) n c) 2n - 1 d) None 7. The number of connected components in G is: a) 2n b) n + 2 c) n C 2 d) None 8. There are 5 nested loops written as follows, int counter = 0; for (int loop_1=0; loop_1 10; loop_1++) { for (int loop_2=loop_1 + 1; loop_2 10; loop_2++) { for (int loop_3=loop_2 + 1; loop_3 10; loop_3++) { for (int loop_4=loop_3 + 1; loop_4 10; loop_4++) { for (int loop_5=loop_4 + 1; loop_5 10; loop_5++) { counter++; } } } } } What will be the value of counter in the end (after all the loops finished running)? a) 15C5 b) 14C5 c) 10C5 d) 10 * 9 * 8 * 7 * 6 * 5 Answer is D -- 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.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, Let's not do it your way or my way; let's do it the best way. -- 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, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] What would be the output of the following program..?
answer will be -1 because the statement in while loop will never executed as (+(+0)!=0) this will be evaluated as false because zero is not equal to zero and i is decremented in here but decrementation is postfix uses the value first and decrement it after sequence point which is the condition point of while loop and hence the answer is -1 On Mon, Dec 13, 2010 at 8:15 PM, siva viknesh sivavikne...@gmail.comwrote: int main() { int i=0; while(+(+i--)!=0) i-=i++; printf(%d\n,i); return 0; } (a) -1 (b) 1 (c) -65535 (d) 0 Ans is option 'a' .. but how?? anybody help plz? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@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.
Re: [algogeeks] Re: matrix sum
question is based on simple D.P. use an auxiliary matrix to record the sum of all rectangles we are possible and use this matrix in subsequent quering there is an example 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 this is our original matrix now keep on doing the sum on auxiliary matrix aux[i][j]=aux[i-1][j]+aux[i][j-1]+original[i][j] this is the relation . hope this helps correct me if i m wrong. On Tue, Dec 14, 2010 at 2:52 PM, juver++ avpostni...@gmail.com wrote: O(nm) preprocessing is required. A[i][j] contains sum of all numbers which lies into a rectangle with bottom right corner at (i, j). To answer the query: decompose rectangles and find the answer via some addition and subtractions. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@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.
Re: [algogeeks] Google interview question
i have a one idea in my mind is to implement a hash table structure based on 26 alphabets and a data structure of words. struct word { int info; char a[n]; }; structure contains the info about the word and an array in which document it is present or not out of n ex if it is word is mnnit and it is in document 1 ,4,6,9 the info of the structure would be char[1,4,6,9]=1 and the rest are zero. insertion of word would take o(1) time but searching would take o(n) time if list is implemented as an array list and if implemented as an binary search tree would take it log(n) but than insertion would also take log(n) time On Mon, Dec 13, 2010 at 9:55 PM, GOBIND KUMAR gobind@gmail.com wrote: One of my friends attended google interview.This was one the question asked. you are given N documents(possibly in millions) with words in them. design datastructures such that the following scenarios take optimal time: a. print all the the docs having a given word b. print the docs having both of 2 given words Help me in solving this problem. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@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.