Re: [algogeeks] Google written test
@Gene : your code will work fine by changing the argument passed from main(), you just need to call rite f(n, 1, 1); from main instead of f(n, 1, 0); On Mon, Mar 19, 2012 at 10:10 AM, atul anand atul.87fri...@gmail.comwrote: @all : i guess question is on Fibonacci coding. here you can find the algo :- http://en.wikipedia.org/wiki/Fibonacci_coding On Sun, Mar 18, 2012 at 2:58 AM, Atul Singh atulsingh7...@gmail.comwrote: @Ravi... there should be only one answer as for fibonacci representation of a number we have to include the part of the fibonacci number just less than the number then remaining part of the sum is filled by fibonacci numbers starting from 1 suppose we have to convert 6 into fibonacci representation then 6 has two sum sets as {1,2,3} or {1,5} then the fibonacci number just less than 6 is 5 so bit representing 5 is set then for completing the sum to 6 bit 1 is also set. so *fibonacci representation of 6 is 1001 .* not 0111 ATul Singh | Final Year | Computer Science Engineering | NIT Jalandhar | 9530739855 | -- 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] Google written test
@all : i guess question is on Fibonacci coding. here you can find the algo :- http://en.wikipedia.org/wiki/Fibonacci_coding On Sun, Mar 18, 2012 at 2:58 AM, Atul Singh atulsingh7...@gmail.com wrote: @Ravi... there should be only one answer as for fibonacci representation of a number we have to include the part of the fibonacci number just less than the number then remaining part of the sum is filled by fibonacci numbers starting from 1 suppose we have to convert 6 into fibonacci representation then 6 has two sum sets as {1,2,3} or {1,5} then the fibonacci number just less than 6 is 5 so bit representing 5 is set then for completing the sum to 6 bit 1 is also set. so *fibonacci representation of 6 is 1001 .* not 0111 ATul Singh | Final Year | Computer Science Engineering | NIT Jalandhar | 9530739855 | -- 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] Google written test
Hello! I got to know that Google visited several colleges in last week. They will be visiting my campus on 20th. Please let us know pattern questions if you know. Thanks, - RD -- 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 written test
20 multiple choice questions out of which around 10 were from the GATE '12 paper. 1 coding question: Represent a no in its Fibonacci representation. Ex- 15 can be represented as 100010 (1*13+0*8+0*5+0*3+1*2+0*1) On Sat, Mar 17, 2012 at 6:39 PM, Ronit Douglas ronit.doug...@gmail.comwrote: Hello! I got to know that Google visited several colleges in last week. They will be visiting my campus on 20th. Please let us know pattern questions if you know. Thanks, - RD -- 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 Chandak -- 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 written test
@ if for a given number more than 1 answer exist then whats the answer??? -- 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 written test
@Ravi... there should be only one answer as for fibonacci representation of a number we have to include the part of the fibonacci number just less than the number then remaining part of the sum is filled by fibonacci numbers starting from 1 suppose we have to convert 6 into fibonacci representation then 6 has two sum sets as {1,2,3} or {1,5} then the fibonacci number just less than 6 is 5 so bit representing 5 is set then for completing the sum to 6 bit 1 is also set. so *fibonacci representation of 6 is 1001 .* not 0111 ATul Singh | Final Year | Computer Science Engineering | NIT Jalandhar | 9530739855 | -- 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] Google written
Hello All! Google is going to visit my campus soon. Hence, I want to know - - Format of the test - Qs - in case you remember - Coding question in the apti Please reply if you have information about this. 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.
Re: [algogeeks] google written
see the string as S.S` where S` is all but the last char of S. now in this string for all valid char set, find the least weight char say for example a in a-z. Store its positions in hash-map(hash is O(1) fn). Now for each of these positions,call recursively n times, finally set will have only 1 string.. ' Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Fri, Jan 14, 2011 at 2:15 PM, radha krishnan radhakrishnance...@gmail.com wrote: There s O(n) solution for this :) On Fri, Jan 14, 2011 at 2:13 PM, radha krishnan radhakrishnance...@gmail.com wrote: append the string to original string and index=answer of that spoj problem now u can ouput the string from index to index+strlen(originalstring)-1 On Fri, Jan 14, 2011 at 2:12 PM, radha krishnan radhakrishnance...@gmail.com wrote: wow This s a spoj problem http://www.spoj.pl/problems/MINMOVE/ On Fri, Jan 14, 2011 at 1:40 PM, snehal jain learner@gmail.com wrote: Write the code to find lexicographic minimum in a circular array, e.g. for the array BCABDADAB, the lexicographic mininum is ABBCABDAD. -- 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.
[algogeeks] google written
Write the code to find lexicographic minimum in a circular array, e.g. for the array BCABDADAB, the lexicographic mininum is ABBCABDAD. -- 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 written
wow This s a spoj problem http://www.spoj.pl/problems/MINMOVE/ On Fri, Jan 14, 2011 at 1:40 PM, snehal jain learner@gmail.com wrote: Write the code to find lexicographic minimum in a circular array, e.g. for the array BCABDADAB, the lexicographic mininum is ABBCABDAD. -- 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] google written
There s O(n) solution for this :) On Fri, Jan 14, 2011 at 2:13 PM, radha krishnan radhakrishnance...@gmail.com wrote: append the string to original string and index=answer of that spoj problem now u can ouput the string from index to index+strlen(originalstring)-1 On Fri, Jan 14, 2011 at 2:12 PM, radha krishnan radhakrishnance...@gmail.com wrote: wow This s a spoj problem http://www.spoj.pl/problems/MINMOVE/ On Fri, Jan 14, 2011 at 1:40 PM, snehal jain learner@gmail.com wrote: Write the code to find lexicographic minimum in a circular array, e.g. for the array BCABDADAB, the lexicographic mininum is ABBCABDAD. -- 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] google written
FindStartIndex(char[] a) { int start = 0; int current = 1; while(current a.Length) { if(a[current] a[start]) { start = current; ++current; }else if(a[current] a[start]) { ++current; }else //a[current] == a[start] { int lookforward = 0; int startnext = start; int currentnext = current; while(startnext != currnet a[startnext] == a[currentnext]) { ++lookforward; startnext = (start + lookforward) % a.Length; currentnext = (current + lookforward) % a.Length; }//finish when compare to current head or there is different if(startnext == current || a[startnext] a[currentnext]) { if(current currentnext) { break; }else { current = currentnext+1; } } else //a[startnext] a[currentnext] { start = current; if(current currentnext) { current = currentnext + 1; }else { break; } } } } return start; } On Fri, Jan 14, 2011 at 12:45 AM, radha krishnan radhakrishnance...@gmail.com wrote: There s O(n) solution for this :) On Fri, Jan 14, 2011 at 2:13 PM, radha krishnan radhakrishnance...@gmail.com wrote: append the string to original string and index=answer of that spoj problem now u can ouput the string from index to index+strlen(originalstring)-1 On Fri, Jan 14, 2011 at 2:12 PM, radha krishnan radhakrishnance...@gmail.com wrote: wow This s a spoj problem http://www.spoj.pl/problems/MINMOVE/ On Fri, Jan 14, 2011 at 1:40 PM, snehal jain learner@gmail.com wrote: Write the code to find lexicographic minimum in a circular array, e.g. for the array BCABDADAB, the lexicographic mininum is ABBCABDAD. -- 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.
Re: [algogeeks] google written
@qw I think you solution will timed out?! -- 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 written
@juver++, can you give me a test case that will time out? On Fri, Jan 14, 2011 at 6:44 AM, juver++ avpostni...@gmail.com wrote: @qw I think you solution will timed out?! -- 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.
Re: [algogeeks] google written
@qw Please ignore my post. I've already removed it. Cause I found it seems to be ok. -- 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.