Re: [algogeeks] Re: amazon interview questions
Hassan geke should not be a valid string. The question states which have the same substring following it so here e follows e. There is no precondition that it has to follow immediate. Utsav: can you clarify? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jun 5, 2012 at 11:32 PM, Hassan Monfared hmonfa...@gmail.comwrote: yes It's valid, cuz it doesn't have any repeated substring next together On Tue, Jun 5, 2012 at 7:08 PM, Lomash Goyal lomesh.go...@gmail.comwrote: is geke is a invalid strng? On Tue, Jun 5, 2012 at 12:17 PM, Hassan Monfared hmonfa...@gmail.comwrote: Ashish: the algorithm passes over string and check if there is any substring with len=1 is repeated or not. if not, tries for substring with len 2,... and so on. max length of substring which can be repeated can be at most N/2. Regards, On Tue, Jun 5, 2012 at 10:48 AM, Ashish Goel ashg...@gmail.com wrote: The problem suggests that a character can't be more than once present and thereby it can be done by just having s bitmap and if a char repeats, any longer repeating substring will have those char repeated atleast twice, hence O(n) solution. Also, Hasaan: how is your algo O(n2) for for-while-for chain? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jun 5, 2012 at 11:42 AM, Ashish Goel ashg...@gmail.com wrote: Hassan, can you explain your algo? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Mon, Jun 4, 2012 at 11:20 AM, Hassan Monfared hmonfa...@gmail.comwrote: for -- 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 Lomash Goyal * * -- 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: interview HARD problem
Gene, you are right, the rectangle is valid if rotated by 90 degrees too. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jun 5, 2012 at 7:45 PM, Gene gene.ress...@gmail.com wrote: Does this sufficae? Suppose you were using a dictionary from the frapplewonk language, which has only 5 words: tab oma to am ba Then the biggest rectangle is clearly tab oma On Jun 4, 10:39 pm, Ashish Goel ashg...@gmail.com wrote: preparing a sample itself is a great problem here, that is why i called it hard all words in the rectangle horizontally as well as vertically needs to be valid dictionary words Ashish Hassan say this rectangle AH,SA,HS,IS,SA,HN should also be valid dictonary words, indeed they are not.. definitely we will need a multimap to have words of same length forming a bucket..not able to think beyond this Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Mon, Jun 4, 2012 at 6:38 PM, Hassan Monfared hmonfa...@gmail.com wrote: Give a sample please On Mon, Jun 4, 2012 at 5:34 PM, Ashish Goel ashg...@gmail.com wrote: Given a dictionary of millions of words, give an algorithm to find the largest possible rectangle of letter that every row forms a word(reading left to right) and every column forms a word(reading from top to bottom). Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- 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: amazon interview questions
nope geke is valid string.. here is the link from where question was taken http://geeksforgeeks.org/forum/topic/amazon-interview-question-password-checker On Wed, Jun 6, 2012 at 11:44 AM, Ashish Goel ashg...@gmail.com wrote: Hassan geke should not be a valid string. The question states which have the same substring following it so here e follows e. There is no precondition that it has to follow immediate. Utsav: can you clarify? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jun 5, 2012 at 11:32 PM, Hassan Monfared hmonfa...@gmail.comwrote: yes It's valid, cuz it doesn't have any repeated substring next together On Tue, Jun 5, 2012 at 7:08 PM, Lomash Goyal lomesh.go...@gmail.comwrote: is geke is a invalid strng? On Tue, Jun 5, 2012 at 12:17 PM, Hassan Monfared hmonfa...@gmail.comwrote: Ashish: the algorithm passes over string and check if there is any substring with len=1 is repeated or not. if not, tries for substring with len 2,... and so on. max length of substring which can be repeated can be at most N/2. Regards, On Tue, Jun 5, 2012 at 10:48 AM, Ashish Goel ashg...@gmail.com wrote: The problem suggests that a character can't be more than once present and thereby it can be done by just having s bitmap and if a char repeats, any longer repeating substring will have those char repeated atleast twice, hence O(n) solution. Also, Hasaan: how is your algo O(n2) for for-while-for chain? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jun 5, 2012 at 11:42 AM, Ashish Goel ashg...@gmail.comwrote: Hassan, can you explain your algo? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Mon, Jun 4, 2012 at 11:20 AM, Hassan Monfared hmonfa...@gmail.com wrote: for -- 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 Lomash Goyal * * -- 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: amazon interview questions
geke is valid. BTW if you changeif(i=len) toif(i0) my code outputs geke is invalid.( what you desired) if geke is invalid regarding to the question, then you can achieve the answer in nLogn by sorting strings :s[0..n-1], s[1..n-1],s[n-1..n-1] and comparing adjacent members. Regards On Wed, Jun 6, 2012 at 11:52 AM, atul anand atul.87fri...@gmail.com wrote: nope geke is valid string.. here is the link from where question was taken http://geeksforgeeks.org/forum/topic/amazon-interview-question-password-checker On Wed, Jun 6, 2012 at 11:44 AM, Ashish Goel ashg...@gmail.com wrote: Hassan geke should not be a valid string. The question states which have the same substring following it so here e follows e. There is no precondition that it has to follow immediate. Utsav: can you clarify? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jun 5, 2012 at 11:32 PM, Hassan Monfared hmonfa...@gmail.comwrote: yes It's valid, cuz it doesn't have any repeated substring next together On Tue, Jun 5, 2012 at 7:08 PM, Lomash Goyal lomesh.go...@gmail.comwrote: is geke is a invalid strng? On Tue, Jun 5, 2012 at 12:17 PM, Hassan Monfared hmonfa...@gmail.comwrote: Ashish: the algorithm passes over string and check if there is any substring with len=1 is repeated or not. if not, tries for substring with len 2,... and so on. max length of substring which can be repeated can be at most N/2. Regards, On Tue, Jun 5, 2012 at 10:48 AM, Ashish Goel ashg...@gmail.comwrote: The problem suggests that a character can't be more than once present and thereby it can be done by just having s bitmap and if a char repeats, any longer repeating substring will have those char repeated atleast twice, hence O(n) solution. Also, Hasaan: how is your algo O(n2) for for-while-for chain? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jun 5, 2012 at 11:42 AM, Ashish Goel ashg...@gmail.comwrote: Hassan, can you explain your algo? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Mon, Jun 4, 2012 at 11:20 AM, Hassan Monfared hmonfa...@gmail.com wrote: for -- 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 Lomash Goyal * * -- 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] want to create a table of words having 2 columns seperate for name and surname
its only for 2 words in a namejohn kennedy On Tuesday, June 5, 2012 3:22:44 PM UTC+5:30, Prem wrote: More than a programming, I believe this is a logical question. Some of the assumption you can take into consideration is how many names a particular person can possibly have. say, John F Kennedy, So, your array now can't hold 3 names in two dimension, so what you wanna do, increase an array of one more dimension? or make John F in one and kennedy in other. Now programming is fairly easy after you hv fixed your approach, alll you have to do is make sure what goes in first dimension and what in second or so.. and accordinly push it. Also I got confusion here are you expecting command like argument . as givn in sample input, than use argv / argc .. why cout/cin !!! Anyway.. try your luck !! BR, Prem On Tue, Jun 5, 2012 at 2:35 PM, daksh_ddt dakshtapa...@gmail.com wrote: #includeconio.h #includeiostream using namespace std; int main() { char crew[2][2][10]; cincrew[0]; coutendl; cincrew[1]; coutcrew[0][0]crew[0][1]crew[1][0]crew[1][1]; getch(); return 0; } now if I give input jack sparrow robert langdon crew[o][o] should be jack crew[0][1] should be sparrow crew[1][0] should be robert crew[1][1] sbould b2 langdon but this is incorrect -- 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/-/1skPXOE7zboJ. 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 view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/35sjxYIwCRMJ. 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] Abhishek Sharma wants to chat
--- Abhishek Sharma wants to stay in better touch using some of Google's coolest new products. If you already have Gmail or Google Talk, visit: http://mail.google.com/mail/b-f2b6967bf6-d78b18cba1-gqPKMkil32YfIMUTyJpM7kfmucY You'll need to click this link to be able to chat with Abhishek Sharma. To get Gmail - a free email account from Google with over 7,500 megabytes of storage - and chat with Abhishek Sharma, visit: http://mail.google.com/mail/a-f2b6967bf6-d78b18cba1-gqPKMkil32YfIMUTyJpM7kfmucY?pc=en-rf---a Gmail offers: - Instant messaging right inside Gmail - Powerful spam protection - Built-in search for finding your messages and a helpful way of organizing emails into conversations - No pop-up ads or untargeted banners - just text ads and related information that are relevant to the content of your messages All this, and it's yours for free. But wait, there's more! By opening a Gmail account, you also get access to Google Talk, Google's instant messaging service: http://www.google.com/talk/ Google Talk offers: - Web-based chat that you can use anywhere, without a download - A contact list that's synchronized with your Gmail account - Free, high quality PC-to-PC voice calls when you download the Google Talk client We're working hard to add new features and make improvements, so we might also ask for your comments and suggestions periodically. We appreciate your help in making our products even better! Thanks, The Google Team To learn more about Gmail and Google Talk, visit: http://mail.google.com/mail/help/about.html http://www.google.com/talk/about.html (If clicking the URLs in this message does not work, copy and paste them into the address bar of your browser). -- 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] 2 Dim array as parameter
Hi, traditional C style of passing 2D array to a C func is for example, void func(char **pArr, int m, int n). Like we validate a pointer before accessing it if it is valid, how do we verify that the array provided indeed has got memory allocated to it before accessing it Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- 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] MS Question : find word in 2D array
WAP to find a word in a 2D array. The word can be formed on row/col/diagnal/reverse diagnal Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- 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] MS Q: how to test a driverless car?
Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- 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] MS Question : find word in 2D array
i did this question long time back well simple brute force check can be doneyou can keep one flag matrix of same size to avoid necessary recursion. On 6/6/12, Ashish Goel ashg...@gmail.com wrote: WAP to find a word in a 2D array. The word can be formed on row/col/diagnal/reverse diagnal Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- 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] 2 Dim array as parameter
check the return value of malloc. on success,it returns the pointer to that memory on error, it returns NULL .. if( (char*)malloc(10)==NULL) { printf(Not Enough memory available); exit(1); } On Wed, Jun 6, 2012 at 7:20 PM, Ashish Goel ashg...@gmail.com wrote: Hi, traditional C style of passing 2D array to a C func is for example, void func(char **pArr, int m, int n). Like we validate a pointer before accessing it if it is valid, how do we verify that the array provided indeed has got memory allocated to it before accessing it Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- 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. -- Abhishek Sharma Under-Graduate Student, PEC University of Technology -- 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: amazon interview questions
@ashish:- geke is valid as repeated substrings should be immediate. On Wed, Jun 6, 2012 at 1:44 PM, Hassan Monfared hmonfa...@gmail.com wrote: geke is valid. BTW if you changeif(i=len) toif(i0) my code outputs geke is invalid.( what you desired) if geke is invalid regarding to the question, then you can achieve the answer in nLogn by sorting strings :s[0..n-1], s[1..n-1],s[n-1..n-1] and comparing adjacent members. Regards On Wed, Jun 6, 2012 at 11:52 AM, atul anand atul.87fri...@gmail.comwrote: nope geke is valid string.. here is the link from where question was taken http://geeksforgeeks.org/forum/topic/amazon-interview-question-password-checker On Wed, Jun 6, 2012 at 11:44 AM, Ashish Goel ashg...@gmail.com wrote: Hassan geke should not be a valid string. The question states which have the same substring following it so here e follows e. There is no precondition that it has to follow immediate. Utsav: can you clarify? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jun 5, 2012 at 11:32 PM, Hassan Monfared hmonfa...@gmail.comwrote: yes It's valid, cuz it doesn't have any repeated substring next together On Tue, Jun 5, 2012 at 7:08 PM, Lomash Goyal lomesh.go...@gmail.comwrote: is geke is a invalid strng? On Tue, Jun 5, 2012 at 12:17 PM, Hassan Monfared hmonfa...@gmail.comwrote: Ashish: the algorithm passes over string and check if there is any substring with len=1 is repeated or not. if not, tries for substring with len 2,... and so on. max length of substring which can be repeated can be at most N/2. Regards, On Tue, Jun 5, 2012 at 10:48 AM, Ashish Goel ashg...@gmail.comwrote: The problem suggests that a character can't be more than once present and thereby it can be done by just having s bitmap and if a char repeats, any longer repeating substring will have those char repeated atleast twice, hence O(n) solution. Also, Hasaan: how is your algo O(n2) for for-while-for chain? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jun 5, 2012 at 11:42 AM, Ashish Goel ashg...@gmail.comwrote: Hassan, can you explain your algo? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Mon, Jun 4, 2012 at 11:20 AM, Hassan Monfared hmonfa...@gmail.com wrote: for -- 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 Lomash Goyal * * -- 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. -- *DARPAN BAWEJA* *3rd year, I.T* *MNNIT Allahabad* -- You received
Re: [algogeeks] Matrix Minimum Path Sum
http://www.geeksforgeeks.org/archives/14943 On Mon, Jun 4, 2012 at 7:57 PM, Decipher ankurseth...@gmail.com wrote: @Victor - Someone had asked this question from me !! He told me its from Project Euler Q-83. @Hassan - I think you are right. This question can be solved by Dijikstra's algo, if we consider the matrix elements as weights. On Monday, 4 June 2012 16:28:31 UTC+5:30, Hassan Monfared wrote: moving must be done in A* style On Mon, Jun 4, 2012 at 1:17 PM, atul anand atul.87fri...@gmail.comwrote: i dont think so dijistra will worh here..bcozz we cannot move diagonally ...but according to matrix this path can be considered. On Mon, Jun 4, 2012 at 1:39 PM, Hassan Monfared hmonfa...@gmail.comwrote: for non-negative values Dijkstra will solve the problem in ( O(N^2) ) and Floyd-Warshal is the solution for negative cells. ( O(N^3) ) On Mon, Jun 4, 2012 at 11:20 AM, atul anand atul.87fri...@gmail.comwrote: this recurrence wont work..ignore On Mon, Jun 4, 2012 at 8:55 AM, atul anand atul.87fri...@gmail.comwrote: find cumulative sum row[0] find cumulative sum of col[0] after this following recurrence will solve the problem. start from mat[1][1] mat[i][j]=mat[i][j]+min( mat[i][j-1] , mat[i-1][j] ) On Sun, Jun 3, 2012 at 7:30 PM, Decipher ankurseth...@gmail.comwrote: Q) In the 5 by 5 matrix below, the minimal path sum from the top left to the bottom right, by moving left, right, up, and down, is indicated in bold red and is equal to 2297. *131* 673 *234* *103* *18* *201* *96* *342* 965 *150* 630 803 746 *422* *111* 537 699 497 *121* 956 805 732 524 *37* *331* Write an algorithm to find the same. Also, write an algorithm if the same matrix contains negative numbers (maybe negative cycle) and compare the space and time complexity of both. -- 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/-/3JeyGNqWbs8Jhttps://groups.google.com/d/msg/algogeeks/-/3JeyGNqWbs8J . To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscribe@ **googlegroups.com algogeeks%2bunsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/** group/algogeeks?hl=enhttp://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+unsubscribe@** googlegroups.com algogeeks%2bunsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/** group/algogeeks?hl=en 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+unsubscribe@** googlegroups.com algogeeks%2bunsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/** group/algogeeks?hl=en 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+unsubscribe@** googlegroups.com algogeeks%2bunsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/** group/algogeeks?hl=en http://groups.google.com/group/algogeeks?hl=en. -- 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/-/l9UCuzmoZRMJ. 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] If any one have algorithms for interviews by adnan aziz ebook... Please mail ...
@abhishek pls send link me too... thanks. On Mon, Jun 4, 2012 at 5:54 PM, Abhishek Sharma abhi120...@gmail.comwrote: mailing you the link for same On Mon, Jun 4, 2012 at 1:31 AM, Dhaval Moliya moliyadha...@gmail.comwrote: If any one have algorithms for interviews by adnan aziz ebook... Please mail ... 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.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Abhishek Sharma Under-Graduate Student, PEC University of Technology -- 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. -- Thanks Regards Amritpal singh -- 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] What would be the output for the following code fragment?
main() { int i=300; char *ptr = i; *++ptr=2; printf(%d,i); } -- 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] Matrix Minimum Path Sum
Basic Dijikstra problem . :-) On Wed, Jun 6, 2012 at 6:13 AM, Dheeraj Jain dheerajj...@gmail.com wrote: http://www.geeksforgeeks.org/archives/14943 On Mon, Jun 4, 2012 at 7:57 PM, Decipher ankurseth...@gmail.com wrote: @Victor - Someone had asked this question from me !! He told me its from Project Euler Q-83. @Hassan - I think you are right. This question can be solved by Dijikstra's algo, if we consider the matrix elements as weights. On Monday, 4 June 2012 16:28:31 UTC+5:30, Hassan Monfared wrote: moving must be done in A* style On Mon, Jun 4, 2012 at 1:17 PM, atul anand atul.87fri...@gmail.comwrote: i dont think so dijistra will worh here..bcozz we cannot move diagonally ...but according to matrix this path can be considered. On Mon, Jun 4, 2012 at 1:39 PM, Hassan Monfared hmonfa...@gmail.comwrote: for non-negative values Dijkstra will solve the problem in ( O(N^2) ) and Floyd-Warshal is the solution for negative cells. ( O(N^3) ) On Mon, Jun 4, 2012 at 11:20 AM, atul anand atul.87fri...@gmail.comwrote: this recurrence wont work..ignore On Mon, Jun 4, 2012 at 8:55 AM, atul anand atul.87fri...@gmail.comwrote: find cumulative sum row[0] find cumulative sum of col[0] after this following recurrence will solve the problem. start from mat[1][1] mat[i][j]=mat[i][j]+min( mat[i][j-1] , mat[i-1][j] ) On Sun, Jun 3, 2012 at 7:30 PM, Decipher ankurseth...@gmail.comwrote: Q) In the 5 by 5 matrix below, the minimal path sum from the top left to the bottom right, by moving left, right, up, and down, is indicated in bold red and is equal to 2297. *131* 673 *234* *103* *18* *201* *96* *342* 965 *150* 630 803 746 *422* *111* 537 699 497 *121* 956 805 732 524 *37* *331* Write an algorithm to find the same. Also, write an algorithm if the same matrix contains negative numbers (maybe negative cycle) and compare the space and time complexity of both. -- 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/-/3JeyGNqWbs8Jhttps://groups.google.com/d/msg/algogeeks/-/3JeyGNqWbs8J . To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscribe@**googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/** group/algogeeks?hl=enhttp://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+unsubscribe@* *googlegroups.com algogeeks%2bunsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/** group/algogeeks?hl=enhttp://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+unsubscribe@** googlegroups.com algogeeks%2bunsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/** group/algogeeks?hl=en 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+unsubscribe@** googlegroups.com algogeeks%2bunsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/** group/algogeeks?hl=en http://groups.google.com/group/algogeeks?hl=en. -- 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/-/l9UCuzmoZRMJ. 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
[algogeeks] Differentiate the following declarations.
1. const char *a; 2. char* const a; 3. char const *a; For each of the above, which operation below is legal and which is not? *a='F' a =Hi -- 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] MS Question : find word in 2D array
i think it can be solved using DP word=bcdf take hash of word h[b]=1 h[c]=2 h[d]=3 h[f]=4 given 2d matrix m[][]= {b c b e f g h b c d f p o u d f d f g k p } take another matrix match[][] if( h[ m[i][j] ] 0 ) //if this char is in word then {a=h[ m[i][j] ]; if (match[i-1][j] ==a-1 || match[][]=a-1 || match[][]=a-1 )check prev element of row / diagonal /column match[i][j]=a; } else if char is not matched, then match[i][j] will contain longest prefix match(as in KMP). if at any instance we get match[i][j]==no. of chars in word then we will backtrack it to get the string. correct me if i'm wrong !! On Wed, Jun 6, 2012 at 10:39 PM, atul anand atul.87fri...@gmail.com wrote: i did this question long time back well simple brute force check can be doneyou can keep one flag matrix of same size to avoid necessary recursion. On 6/6/12, Ashish Goel ashg...@gmail.com wrote: WAP to find a word in a 2D array. The word can be formed on row/col/diagnal/reverse diagnal Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- 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. -- Utsav Sharma, 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.
Re: [algogeeks] Re: amazon interview questions
Thanks, my approach prepare a multimap of charcters and their positions by walking over the string. ashishis if is give string the multimap will have a-0 s-1,4,7 h-2,5 i-3,6 now for every character while walkingover the given string again, check from its multimap, if it is repeated, if not continue to next char. but if it is for all possible differences w.r.t this position, find the repeated string eg for s the values are 4-1=3 and 7-1=6 so if the string repeats than the next 3-1 or 6-1 chars should also have the diff exactly the same the next tow chars are h and i for h current pos is 2 and the diff is 5-2=3 which is good for i current pos is 3 and the diff is 6-3=3, hence shi is indeed a repeating string immediately and hence it is not a valid string. Had it not matched, we would have started for string of length 6 starting at a[7]. hope this helps. But this is not O(n) algo. O(n2) actually in worst case. Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Wed, Jun 6, 2012 at 12:52 PM, atul anand atul.87fri...@gmail.com wrote: nope geke is valid string.. here is the link from where question was taken http://geeksforgeeks.org/forum/topic/amazon-interview-question-password-checker On Wed, Jun 6, 2012 at 11:44 AM, Ashish Goel ashg...@gmail.com wrote: Hassan geke should not be a valid string. The question states which have the same substring following it so here e follows e. There is no precondition that it has to follow immediate. Utsav: can you clarify? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jun 5, 2012 at 11:32 PM, Hassan Monfared hmonfa...@gmail.comwrote: yes It's valid, cuz it doesn't have any repeated substring next together On Tue, Jun 5, 2012 at 7:08 PM, Lomash Goyal lomesh.go...@gmail.comwrote: is geke is a invalid strng? On Tue, Jun 5, 2012 at 12:17 PM, Hassan Monfared hmonfa...@gmail.comwrote: Ashish: the algorithm passes over string and check if there is any substring with len=1 is repeated or not. if not, tries for substring with len 2,... and so on. max length of substring which can be repeated can be at most N/2. Regards, On Tue, Jun 5, 2012 at 10:48 AM, Ashish Goel ashg...@gmail.comwrote: The problem suggests that a character can't be more than once present and thereby it can be done by just having s bitmap and if a char repeats, any longer repeating substring will have those char repeated atleast twice, hence O(n) solution. Also, Hasaan: how is your algo O(n2) for for-while-for chain? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jun 5, 2012 at 11:42 AM, Ashish Goel ashg...@gmail.comwrote: Hassan, can you explain your algo? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Mon, Jun 4, 2012 at 11:20 AM, Hassan Monfared hmonfa...@gmail.com wrote: for -- 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 Lomash Goyal * * -- 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
Re: [algogeeks] What would be the output for the following code fragment?
http://ideone.com/Zz7ET On Thu, Jun 7, 2012 at 12:27 AM, g4ur4v gauravyadav1...@gmail.com wrote: main() { int i=300; char *ptr = i; *++ptr=2; printf(%d,i); } -- 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. -- Abhishek Sharma Under-Graduate Student, PEC University of Technology -- 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] Differentiate the following declarations.
In const char *a; and char const *a;both represent the same thing. i.e. the string whose address is store in pointer a is not changeable,but the pointer a can store address of another string if const char *a =Hello; /*string is fixed pointer is not*/ then *a='A';/*Error*/ a=Hi; /*Work*/ char *const a=Hello;/*pointer is fixed string is not*/ then *a='A'; /*Work*/ a=Hi; /*Error*/ On Thu, Jun 7, 2012 at 8:39 AM, shiva@Algo shiv.jays...@gmail.com wrote: const char *a and char const *a are equivalent and 'a' can point to any variable(even that is not constant) but the thing 'a' points to cannot be changed and dont need initialisation const chat * a;//legal char c='b';//legal a=b;//legal *a='d';//illegal c='d';//legal but char * const a --represents a is constatnt pointer that points to a char.so, It needs an initialisation that will be unchanged for its life time. char c='b'; char * const a=c; *a='d';//legal char d='e'; a=d;//illegal On Thu, Jun 7, 2012 at 1:22 AM, g4ur4v gauravyadav1...@gmail.com wrote: 1. const char *a; 2. char* const a; 3. char const *a; For each of the above, which operation below is legal and which is not? *a='F' a =Hi -- 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] Matrix Minimum Path Sum
Guess the same Algo will do the job. So time space and complexity will remain the same. Correct me if 'm wrong. -- 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] If any one have algorithms for interviews by adnan aziz ebook... Please mail ...
@abhishek...Plz share the link here.Thanks -- Prakhar Jain IIIT Allahabad B.Tech IT 3rd Year Mob no: +91 9454992196 E-mail: rit2009...@iiita.ac.in jprakha...@gmail.com On Wed, Jun 6, 2012 at 5:32 PM, amrit harry dabbcomput...@gmail.com wrote: @abhishek pls send link me too... thanks. On Mon, Jun 4, 2012 at 5:54 PM, Abhishek Sharma abhi120...@gmail.comwrote: mailing you the link for same On Mon, Jun 4, 2012 at 1:31 AM, Dhaval Moliya moliyadha...@gmail.comwrote: If any one have algorithms for interviews by adnan aziz ebook... Please mail ... 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.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Abhishek Sharma Under-Graduate Student, PEC University of Technology -- 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. -- Thanks Regards Amritpal singh -- 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.
[algogeeks] Re: What would be the output for the following code fragment?
556 if the machine is little endian 258 if machine is big endian On Jun 6, 11:57 pm, g4ur4v gauravyadav1...@gmail.com wrote: main() { int i=300; char *ptr = i; *++ptr=2; printf(%d,i); } -- 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.