Re: [algogeeks] Re: C++ Riddle
Won't it increment by 2 (or something) and not by 1? Sent from my BlackBerry -Original Message- From: Rajeevpodar rajeevpo...@gmail.com Sender: algogeeks@googlegroups.com Date: Mon, 7 Feb 2011 20:41:32 To: algogeeks@googlegroups.comalgogeeks@googlegroups.com Reply-To: algogeeks@googlegroups.com Subject: Re: [algogeeks] Re: C++ Riddle @ashish: tht's true. But that will be the sum of two numbers. Reason is v store the address in char* so when increment it by other number it will increment that times, that is the required answer. Sent from my iPod On Feb 7, 2011, at 7:14 PM, Ashish Goel ashg...@gmail.com wrote: p[n] gives address of p+n it does not add.. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 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.
Re: [algogeeks] Re: C++ Riddle
Ok. Just checking. Sent from my BlackBerry -Original Message- From: Rajeevpodar rajeevpo...@gmail.com Sender: algogeeks@googlegroups.com Date: Mon, 7 Feb 2011 20:51:33 To: algogeeks@googlegroups.comalgogeeks@googlegroups.com Reply-To: algogeeks@googlegroups.com Subject: Re: [algogeeks] Re: C++ Riddle I tried in vs 2005 in windows and work fine for me. Sent from my iPod On Feb 7, 2011, at 8:45 PM, Sarma Tangirala tvssarma.ome...@gmail.com wrote: Won't it increment by 2 (or something) and not by 1? Sent from my BlackBerry From: Rajeevpodar rajeevpo...@gmail.com Sender: algogeeks@googlegroups.com Date: Mon, 7 Feb 2011 20:41:32 +0530 To: algogeeks@googlegroups.comalgogeeks@googlegroups.com ReplyTo: algogeeks@googlegroups.com Subject: Re: [algogeeks] Re: C++ Riddle @ashish: tht's true. But that will be the sum of two numbers. Reason is v store the address in char* so when increment it by other number it will increment that times, that is the required answer. Sent from my iPod On Feb 7, 2011, at 7:14 PM, Ashish Goel ashg...@gmail.com wrote: p[n] gives address of p+n it does not add.. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 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. -- 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.
Re: [algogeeks] Microsoft interview question
How many test cases were you expected to give? I think one problem you will have is rendering a font on different sizes. A generic test case could be, randomly pick a font and format and then alternate between a few extremes of the font size range and check if they look the same. Another kind of test case would be to randomly take text from the Web and check if you editor is able to identify and render it the same way. You are essentially seeing if your editor is also good at identifying fonts. What were your test cases? Sent from my BlackBerry -Original Message- From: HARISH S.C s.c.har...@gmail.com Sender: algogeeks@googlegroups.com Date: Wed, 2 Feb 2011 01:14:00 To: algogeeks@googlegroups.com Reply-To: algogeeks@googlegroups.com Subject: [algogeeks] Microsoft interview question We have a text editor application where we can choose 1)between 100s of different fonts like arial,calibri,etc.. 2)different text sizes 3) different formatting such as bold, Italics,regular,etc.. Imagine that the application is similar to word(there we will have these options). Now give different test cases to test this application. I came up with different solutions but interviewer is not satisfied, -- 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.
Re: [algogeeks] Microsoft interview question
@guys What's the right answer? Sent from my BlackBerry -Original Message- From: HARISH S.C s.c.har...@gmail.com Sender: algogeeks@googlegroups.com Date: Wed, 2 Feb 2011 13:01:59 To: algogeeks@googlegroups.com Reply-To: algogeeks@googlegroups.com Subject: Re: [algogeeks] Microsoft interview question @Sarma : He said we should finish testing within 2 days. @Gene: I said the same answer but he said its ok for size but for font it will not work because style of each and every font will differ and he said doing exhaustive test for all fonts is not a solution too. On Wed, Feb 2, 2011 at 7:38 AM, Sarma Tangirala tvssarma.ome...@gmail.comwrote: How many test cases were you expected to give? I think one problem you will have is rendering a font on different sizes. A generic test case could be, randomly pick a font and format and then alternate between a few extremes of the font size range and check if they look the same. Another kind of test case would be to randomly take text from the Web and check if you editor is able to identify and render it the same way. You are essentially seeing if your editor is also good at identifying fonts. What were your test cases? Sent from my BlackBerry -- *From: * HARISH S.C s.c.har...@gmail.com *Sender: * algogeeks@googlegroups.com *Date: *Wed, 2 Feb 2011 01:14:00 +0530 *To: *algogeeks@googlegroups.com *ReplyTo: * algogeeks@googlegroups.com *Subject: *[algogeeks] Microsoft interview question We have a text editor application where we can choose 1)between 100s of different fonts like arial,calibri,etc.. 2)different text sizes 3) different formatting such as bold, Italics,regular,etc.. Imagine that the application is similar to word(there we will have these options). Now give different test cases to test this application. I came up with different solutions but interviewer is not satisfied, -- 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.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.
Re: [algogeeks] Count number of digits
Mod 10 and divide by 10 to get each digit and then hash that digit to an array and add one to the array entry. Array from 0 to 9 and initialize to each array value 0. Sent from my BlackBerry -Original Message- From: rgap rgap...@gmail.com Sender: algogeeks@googlegroups.com Date: Tue, 18 Jan 2011 03:31:12 To: Algorithm Geeksalgogeeks@googlegroups.com Reply-To: algogeeks@googlegroups.com Subject: [algogeeks] Count number of digits How can i count the number of digits 0s,1s,2s,3s,... 9s in a number n for example if n=33902 number of 0s=1 number of 3s=2 number of 9s=1 number of 2s=1 -- 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.
Re: [algogeeks] Count number of digits
If the number is larger that 64 bits then treat it as a string but do the same thing apart from mod 10 divide bt 10. Sent from my BlackBerry -Original Message- From: rgap rgap...@gmail.com Sender: algogeeks@googlegroups.com Date: Tue, 18 Jan 2011 03:31:12 To: Algorithm Geeksalgogeeks@googlegroups.com Reply-To: algogeeks@googlegroups.com Subject: [algogeeks] Count number of digits How can i count the number of digits 0s,1s,2s,3s,... 9s in a number n for example if n=33902 number of 0s=1 number of 3s=2 number of 9s=1 number of 2s=1 -- 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.
Re: [algogeeks] Re: google mcqs
Are larger RAMs faster? I am so sure about that. Sent from my BlackBerry -Original Message- From: Bhavesh agrawal agr.bhav...@gmail.com Sender: algogeeks@googlegroups.com Date: Mon, 17 Jan 2011 09:36:20 To: algogeeks@googlegroups.com Reply-To: algogeeks@googlegroups.com Subject: Re: [algogeeks] Re: google mcqs answer is b Increasing the RAM of a computer typically improves performance because: a. Virtual memory increases b. Larger RAMs are faster c. Fewer segmentation faults occur d. Fewer page faults occur -- 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.