[algogeeks] Compiler Design Help
someone please share the solution manual of compiler design by Aho (aka dragon book)... I would be very grateful. Thanks.. -- Harshal. -- 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] National Instruments face to face question
2. First find the given node by traversing tree (BFS) At every level maintain the list of parents of the current level being traversed. Whereever this node is found, then traverse and print both children of each parent in the list. 3. Find the paths to each node from root. This can be done by DFS. Once the 2 paths are found then they act like Singly linked list each (from root to given node). Now this problem becomes finding LCA (least common ancestor) of these tree nodes. Check to find latest common parent by comparing the nodes at each level. Wherever comparison breaks, stop. On Sun, Apr 10, 2011 at 2:54 AM, Anand anandut2...@gmail.com wrote: binary tree On Fri, Apr 8, 2011 at 11:54 PM, ArPiT BhAtNaGaR arpitbhatnagarm...@gmail.com wrote: U sure those r binary tree's not BST On Sat, Apr 9, 2011 at 10:26 AM, Anand anandut2...@gmail.com wrote: 1, You have 52 cards. How will you make your you distribute cards randomly. 2. You have given a binary tree. Given any node, print the all the nodes at the same level. 3. You have given a binary tree and two given nodes. Find the distance between two nodes. -- 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. -- 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. -- 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:
do post the sln after attending the class On 4/10/11, himanshu kansal himanshukansal...@gmail.com wrote: Rofl:D:D On Sun, Apr 10, 2011 at 12:01 AM, ArPiT BhAtNaGaR arpitbhatnagarm...@gmail.com wrote: lol funniest moment of Algogeeks On Sun, Apr 3, 2011 at 9:51 PM, Umer Farooq the.um...@gmail.com wrote: hhahahahahahahhahaha Bohat aalaa sir! :D caught red-handed :D :P Ow please tell us the solution, I'm interested in knowing the answer :D On Sun, Apr 3, 2011 at 9:02 PM, Carl Barton odysseus.ulys...@gmail.comwrote: Haha On 3 April 2011 15:28, Arpit Sood soodfi...@gmail.com wrote: assignment problem ? haha On Sun, Apr 3, 2011 at 7:16 PM, Dr. Deepak Garg dr.gar...@gmail.comwrote: Beta, puchna hi tha, to mujhse puchte! Anyways, you will get the solution in tomorrow's lecture @1pm. I have gone through your profile. See me in my cabin after the class. Make sure that you attend tomorrow's lecture. For now, study dynamic programming.. On Apr 3, 6:03 pm, SANDEEP AAMIN sandeep.aa...@gmail.com wrote: hey guys please help me to solve this QUESTION : input a number C , an output all of the ways that a group of ascending positive numbers can be summed to give C. for e.g if C=6,the output should be 1+2+3 1+5 2+4 [solve using dynamic programming] please tell me about this.. -- 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, Arpit Sood -- 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. -- Umer -- 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. -- 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. -- 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] flux redirction
Hi, I m looking for a way to redirecte my program output and input in windows thank you, sorry for my english -- 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 ques
@aakash: you are given an array A of k values which contain int values in sorted (asec) order. Now u can understand it as if you have to create a new array which contains all elements , and sum of every two elements taken at a time and sum of all three elements taken at a time. eg if array is {a,b,c,d,e} then find top max k element from the following {a,b,c,d,e,a+b,a+c,a+d,a+e,b+c,b+d,b+e,c+d,c+e,d+e, a+b+c, a+b+d, ..., c+d+e} this new set contains C(k,1) + C(k,2) + C(k,3) elements. On Sat, Apr 9, 2011 at 12:13 PM, ArPiT BhAtNaGaR arpitbhatnagarm...@gmail.com wrote: WELL my answer is complexity is between n^2 to n SOLUTION LIES WITHIN THE SOLUTION Array AS: A= {3 4 5 15 19 20 25} first we have in B={ 3,4}now we have PTR1 @ 5andPTR2 always one less thab PTR1 means @ 4 now from B[0] upto the same element ie 4 add ptr2 and check 3+45 so we hav B={3,4,5}now ptr1 @15 and ptr2 @ 5 checking with B[0] 3+515 4+5 15 so B={3,4,5,8,9} Now we missed one thing that is 12 so we need one more check that is while we move to to each node we can remeber sum that is while on 4 we have 7 on 5 we have 12 so we need to check also we SUM 15we add 12 so B={3,4,5,8,9,12} IMP NOTE : we check sum only if pointer moving from B[0] to reaches the no. itself next we hav ptr1 @ 19 ptr2 @ 15so 15+b[0] =15+31915+4=19 so we insert B={3,4,5,8,9,12,15,18} sum=3+4+5+8 =12+8=20 as sum19 so no change 3,4,5,8,9,12,15,18,19,20, 20+B[0] =23 ,20+b[1]=24 ,25 so on On Fri, Apr 8, 2011 at 11:44 PM, Akash Agrawal akash.agrawa...@gmail.comwrote: what do u mean by* top k values?* can't the answer be 3,4,5,15,3+15 etc Regards, Akash Agrawal http://tech-queries.blogspot.com/ On Fri, Apr 8, 2011 at 7:22 PM, saurabh agrawal saurabh...@gmail.comwrote: ou are given an array A of k values which contain int values in sorted (asec) order. Find top k values (asec) which can either be the number from the array A, or sum of any two numbers from A or sum of any three numbers from A. So, if A's values are represented as : a1,a2,...,ak , the possible numbers can be: a(i), a(i)+a(j), a(i)+a(j)+a(l) for any i,j,l k Ex: A[7] = {3,4,5,15,19,20,25} output B[7] = {3,4,5,(3+4),(3+5),(4+5),(3+4+5)} -- 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. -- 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. -- 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:
no need to laugh guys... that id is a fake one.. thats not the id of our sir... On Sun, Apr 10, 2011 at 2:49 PM, sukhmeet singh sukhmeet2...@gmail.comwrote: do post the sln after attending the class On 4/10/11, himanshu kansal himanshukansal...@gmail.com wrote: Rofl:D:D On Sun, Apr 10, 2011 at 12:01 AM, ArPiT BhAtNaGaR arpitbhatnagarm...@gmail.com wrote: lol funniest moment of Algogeeks On Sun, Apr 3, 2011 at 9:51 PM, Umer Farooq the.um...@gmail.com wrote: hhahahahahahahhahaha Bohat aalaa sir! :D caught red-handed :D :P Ow please tell us the solution, I'm interested in knowing the answer :D On Sun, Apr 3, 2011 at 9:02 PM, Carl Barton odysseus.ulys...@gmail.comwrote: Haha On 3 April 2011 15:28, Arpit Sood soodfi...@gmail.com wrote: assignment problem ? haha On Sun, Apr 3, 2011 at 7:16 PM, Dr. Deepak Garg dr.gar...@gmail.comwrote: Beta, puchna hi tha, to mujhse puchte! Anyways, you will get the solution in tomorrow's lecture @1pm. I have gone through your profile. See me in my cabin after the class. Make sure that you attend tomorrow's lecture. For now, study dynamic programming.. On Apr 3, 6:03 pm, SANDEEP AAMIN sandeep.aa...@gmail.com wrote: hey guys please help me to solve this QUESTION : input a number C , an output all of the ways that a group of ascending positive numbers can be summed to give C. for e.g if C=6,the output should be 1+2+3 1+5 2+4 [solve using dynamic programming] please tell me about this.. -- 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, Arpit Sood -- 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. -- Umer -- 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. -- 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. -- 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:
and if u want a solution tell me.. i hav solved it... On Sun, Apr 10, 2011 at 6:11 PM, SANDEEP AAMIN sandeep.aa...@gmail.comwrote: no need to laugh guys... that id is a fake one.. thats not the id of our sir... On Sun, Apr 10, 2011 at 2:49 PM, sukhmeet singh sukhmeet2...@gmail.comwrote: do post the sln after attending the class On 4/10/11, himanshu kansal himanshukansal...@gmail.com wrote: Rofl:D:D On Sun, Apr 10, 2011 at 12:01 AM, ArPiT BhAtNaGaR arpitbhatnagarm...@gmail.com wrote: lol funniest moment of Algogeeks On Sun, Apr 3, 2011 at 9:51 PM, Umer Farooq the.um...@gmail.com wrote: hhahahahahahahhahaha Bohat aalaa sir! :D caught red-handed :D :P Ow please tell us the solution, I'm interested in knowing the answer :D On Sun, Apr 3, 2011 at 9:02 PM, Carl Barton odysseus.ulys...@gmail.comwrote: Haha On 3 April 2011 15:28, Arpit Sood soodfi...@gmail.com wrote: assignment problem ? haha On Sun, Apr 3, 2011 at 7:16 PM, Dr. Deepak Garg dr.gar...@gmail.comwrote: Beta, puchna hi tha, to mujhse puchte! Anyways, you will get the solution in tomorrow's lecture @1pm. I have gone through your profile. See me in my cabin after the class. Make sure that you attend tomorrow's lecture. For now, study dynamic programming.. On Apr 3, 6:03 pm, SANDEEP AAMIN sandeep.aa...@gmail.com wrote: hey guys please help me to solve this QUESTION : input a number C , an output all of the ways that a group of ascending positive numbers can be summed to give C. for e.g if C=6,the output should be 1+2+3 1+5 2+4 [solve using dynamic programming] please tell me about this.. -- 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, Arpit Sood -- 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. -- Umer -- 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. -- 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. -- 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.
[algogeeks] Popular Puzzle of the week
Hi, Based on most comments, The popular puzzle of the last week is *http://dailybrainteaser.blogspot.com/2011/04/7april.html?lavesh=lavesh* *Please subscribe and follow this blog to show your liking to the blog.* -- 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:
yes we do On Sun, Apr 10, 2011 at 6:12 PM, SANDEEP AAMIN sandeep.aa...@gmail.comwrote: and if u want a solution tell me.. i hav solved it... On Sun, Apr 10, 2011 at 6:11 PM, SANDEEP AAMIN sandeep.aa...@gmail.comwrote: no need to laugh guys... that id is a fake one.. thats not the id of our sir... On Sun, Apr 10, 2011 at 2:49 PM, sukhmeet singh sukhmeet2...@gmail.comwrote: do post the sln after attending the class On 4/10/11, himanshu kansal himanshukansal...@gmail.com wrote: Rofl:D:D On Sun, Apr 10, 2011 at 12:01 AM, ArPiT BhAtNaGaR arpitbhatnagarm...@gmail.com wrote: lol funniest moment of Algogeeks On Sun, Apr 3, 2011 at 9:51 PM, Umer Farooq the.um...@gmail.com wrote: hhahahahahahahhahaha Bohat aalaa sir! :D caught red-handed :D :P Ow please tell us the solution, I'm interested in knowing the answer :D On Sun, Apr 3, 2011 at 9:02 PM, Carl Barton odysseus.ulys...@gmail.comwrote: Haha On 3 April 2011 15:28, Arpit Sood soodfi...@gmail.com wrote: assignment problem ? haha On Sun, Apr 3, 2011 at 7:16 PM, Dr. Deepak Garg dr.gar...@gmail.comwrote: Beta, puchna hi tha, to mujhse puchte! Anyways, you will get the solution in tomorrow's lecture @1pm. I have gone through your profile. See me in my cabin after the class. Make sure that you attend tomorrow's lecture. For now, study dynamic programming.. On Apr 3, 6:03 pm, SANDEEP AAMIN sandeep.aa...@gmail.com wrote: hey guys please help me to solve this QUESTION : input a number C , an output all of the ways that a group of ascending positive numbers can be summed to give C. for e.g if C=6,the output should be 1+2+3 1+5 2+4 [solve using dynamic programming] please tell me about this.. -- 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, Arpit Sood -- 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. -- Umer -- 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. -- 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. -- 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. -- 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
Re: [algogeeks] [brain teaser ] 8april
Both say lies and A is monkey and B is a human... On Friday, April 8, 2011, Lavesh Rawat lavesh.ra...@gmail.com wrote: Island Puzzle There are people and strange monkeys on this island, and you can not tell who is who. They speak either only the truth or only lies. Who are the following two guys? A: B is a lying monkey. I am human. B: A is telling the truth. Update Your Answers at : Click Here http://dailybrainteaser.blogspot.com/2011/04/8april.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. -- A.Balaji -- 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 ] 8april
both r lier On Sun, Apr 10, 2011 at 11:07 PM, balaji a peshwa.bal...@gmail.com wrote: Both say lies and A is monkey and B is a human... On Friday, April 8, 2011, Lavesh Rawat lavesh.ra...@gmail.com wrote: Island Puzzle There are people and strange monkeys on this island, and you can not tell who is who. They speak either only the truth or only lies. Who are the following two guys? A: B is a lying monkey. I am human. B: A is telling the truth. Update Your Answers at : Click Here http://dailybrainteaser.blogspot.com/2011/04/8april.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. -- A.Balaji -- 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. -- Warm Regards-- Ankur Pratik Computer Science Engg Dept Undergraduate Student National Institute of Technology Durgapur 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.
Re: [algogeeks] Re:
@arpit : use rod cutting algo On Sun, Apr 10, 2011 at 10:51 PM, ArPiT BhAtNaGaR arpitbhatnagarm...@gmail.com wrote: yes we do On Sun, Apr 10, 2011 at 6:12 PM, SANDEEP AAMIN sandeep.aa...@gmail.comwrote: and if u want a solution tell me.. i hav solved it... On Sun, Apr 10, 2011 at 6:11 PM, SANDEEP AAMIN sandeep.aa...@gmail.comwrote: no need to laugh guys... that id is a fake one.. thats not the id of our sir... On Sun, Apr 10, 2011 at 2:49 PM, sukhmeet singh sukhmeet2...@gmail.comwrote: do post the sln after attending the class On 4/10/11, himanshu kansal himanshukansal...@gmail.com wrote: Rofl:D:D On Sun, Apr 10, 2011 at 12:01 AM, ArPiT BhAtNaGaR arpitbhatnagarm...@gmail.com wrote: lol funniest moment of Algogeeks On Sun, Apr 3, 2011 at 9:51 PM, Umer Farooq the.um...@gmail.com wrote: hhahahahahahahhahaha Bohat aalaa sir! :D caught red-handed :D :P Ow please tell us the solution, I'm interested in knowing the answer :D On Sun, Apr 3, 2011 at 9:02 PM, Carl Barton odysseus.ulys...@gmail.comwrote: Haha On 3 April 2011 15:28, Arpit Sood soodfi...@gmail.com wrote: assignment problem ? haha On Sun, Apr 3, 2011 at 7:16 PM, Dr. Deepak Garg dr.gar...@gmail.comwrote: Beta, puchna hi tha, to mujhse puchte! Anyways, you will get the solution in tomorrow's lecture @1pm. I have gone through your profile. See me in my cabin after the class. Make sure that you attend tomorrow's lecture. For now, study dynamic programming.. On Apr 3, 6:03 pm, SANDEEP AAMIN sandeep.aa...@gmail.com wrote: hey guys please help me to solve this QUESTION : input a number C , an output all of the ways that a group of ascending positive numbers can be summed to give C. for e.g if C=6,the output should be 1+2+3 1+5 2+4 [solve using dynamic programming] please tell me about this.. -- 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, Arpit Sood -- 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. -- Umer -- 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. -- 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. -- 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. -- Arpit Bhatnagar (MNIT JAIPUR) -- You received this message because you are subscribed to the Google
Re: [algogeeks] Finding subarray
well i hav deviced a approach : well say we hav sorted array {-1 -3 2 3 3 5 9 13 24} say we hav to seach 6 take sum of all neg no store it -4 means we can atmost reduce any no by 4 units means in any case we cant take no greater than 10-4=6 for finding 6. now locate the upto position just less than we r searching for here 9 now sum up all positive upto 9 3+2+3+3+5 ie 16 now WE hav 3 sets (1) negative no sum (2) postive no less than requred sum (3) greater no set we can easily check here since only of this set less than 10 is useful so we hav 9 check for 9 -1 -3 here we get 6. either way we hav 16 -4 need some thing done here NOT PURE SOLN JUST AN IDEA THOUGH GOOD TO BE SHARE On Thu, Mar 31, 2011 at 1:06 AM, Subhransupanigrahi subhransu.panigr...@gmail.com wrote: could you please point to some similar I just want to validate the approach which I am thinking of. Sent from my iPhone On Mar 31, 2011, at 0:59, hammett hamm...@gmail.com wrote: We did :-) Dynamic programming seems as the best way to approach this kind of problem. On Wed, Mar 30, 2011 at 12:56 AM, Subhransu subhransu.panigr...@gmail.com wrote: For this X = {-1,4,2,3} Nearest will be 4 then remain is 1 but the there is no 1 so again in recursion nearest number is 2 then it search for suitable number where the sum is zero so 3 is not suitable then it will pick the next closest number to 2 which is one and make it (5= 4 + 2 -1 ) I just propose one approach you guys also can think a better one. Subhransu Panigrahi Mobile: +91-9840931538 Email: subhransu.panigr...@gmail.com On Wed, Mar 30, 2011 at 12:55 PM, Saikat Debnath crazysai...@gmail.com wrote: @ Subhranshu : Your approach will fail for a case let X = {-1,4,2,3} and your sum is 5. You will get nearest element 4, but there is no 1 in the set. A DP solution will be like this : Let a[i][j] be the 1 if using the first i elements we can get sum of j, and 0 otherwise. Initialise a[0][j] = 0, a[i][0] = 1; Now a[i][j] = a[i-1][j] | a[i-1][ j - X[i] ], where X[i] is ith element of set X. On Wed, Mar 30, 2011 at 12:35 PM, hammett hamm...@gmail.com wrote: I'd try a tabular approach. Check dynamic programming. Samples like LCS may give you a click. On Tue, Mar 29, 2011 at 11:46 PM, Subhransu subhransu.panigr...@gmail.com wrote: set of integers in an array X that the sum equals a given number N Eg. X = {-1, -3, 5, 13, 2, 24, 9, 3, 3} Lets say the number 5 which can be formed in the following manner 5= 2 + 3 (the values from array). If there is no match it has to return invalid numbers. We also have to see the complexity of the solution. I thought of one approach but not sure if there is more approach where the complexity will be minimal. Lets say sort the array and now take number and find the closest number for that. Then in a recursion manner search for another( Lets say number '5', it search the list and found closest match will be 3. Then recursively search for 3 now where closest match is 2) Any algo with better complexity will be appreciated. Subhransu Panigrahi Email: subhransu.panigr...@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. -- Cheers, hammett http://hammett.castleproject.org/ -- 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. -- Cheers, hammett http://hammett.castleproject.org/ -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to