Re: [algogeeks] amazon
i understand longest subsequence.. but what is longest increasing subsequence .. i dont know the difference between them..plz sumbody tel .. On Tue, Aug 9, 2011 at 9:41 AM, Akash Mukherjee akash...@gmail.com wrote: @udit : thanx man...they were really helpful 2 allcan u plzz chk d answers 4 the qns : 18c,20b also how do i solve 14,16 ?? thanx On Mon, Aug 8, 2011 at 1:24 PM, Udit Gupta uditgupta...@gmail.com wrote: helloamazon's this year paper is attached with d mail cn u plz tell me what questions were there in adobe written and interviews?? On Thu, Aug 4, 2011 at 10:23 PM, Kamakshii Aggarwal kamakshi...@gmail.com wrote: Can anyone please tell what is the procedure for amazon campus recruitment? -- Regards, Kamakshi kamakshi...@gmail.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Re: thought works questions
hello reynald could you plz send me the Thoughtworks questions, thanx On Aug 4, 6:17 am, Reynald Suz reynaldsus...@gmail.com wrote: Thank you so much! Thoughtworks is visiting our campus on Aug-8, I'll send you questions for sure. On Wed, Aug 3, 2011 at 11:14 PM, coder dumca coder.du...@gmail.com wrote: hi reynald i m sending u some question that i have. thought workd is gooing to visit our campys in few days . if it is visiting ur campus befire us then pls send me the questions. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Reynald Reni Masters in Software Engineering CIT - India -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Microsoft written!!!
10 4 5 2 7 6 11 1 39 8 12 13 14 15 i think we should first find the parent of the particular node ..then apply the concept as told by Brijesh on it p =parent(q); r = parent(p); count =1; while(p ==isright(r)) { p=r; r=parent(r); count++; if(r==root) break; } if(d =right(r)) { while(count!=0) { if(d-left) d=d-left; else d=d-right; count--; } } else return NULL; o/p=d-value; -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] amazon
like u have given array *1 2 3 4 5 7* 6 7 8 9 *1 2 3 4 5 6 *5 4 3 6 7 8 ans will be 6 On Wed, Aug 10, 2011 at 11:30 AM, Anika Jain anika.jai...@gmail.com wrote: i understand longest subsequence.. but what is longest increasing subsequence .. i dont know the difference between them..plz sumbody tel .. On Tue, Aug 9, 2011 at 9:41 AM, Akash Mukherjee akash...@gmail.comwrote: @udit : thanx man...they were really helpful 2 allcan u plzz chk d answers 4 the qns : 18c,20b also how do i solve 14,16 ?? thanx On Mon, Aug 8, 2011 at 1:24 PM, Udit Gupta uditgupta...@gmail.comwrote: helloamazon's this year paper is attached with d mail cn u plz tell me what questions were there in adobe written and interviews?? On Thu, Aug 4, 2011 at 10:23 PM, Kamakshii Aggarwal kamakshi...@gmail.com wrote: Can anyone please tell what is the procedure for amazon campus recruitment? -- Regards, Kamakshi kamakshi...@gmail.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: m'th max element
We can use min heap. 1) Build a Min Heap MH of the first m elements (arr[0] to arr[m-1]) of the given array. O(m) 2) For each element, after the mth element (arr[m] to arr[n-1]), compare it with root of MH. a) If the element is greater than the root then make it root and call heapify for MH b) Else ignore it. O((n-m)*logm) 3) Finally, MH has m largest elements and root of the MH is the mth largest element. On Aug 8, 3:57 pm, vijay goswami vjrockks...@gmail.com wrote: run bubble sort for m passes On Mon, Aug 8, 2011 at 4:02 PM, Nitin Nizhawan nitin.nizha...@gmail.comwrote: Selection algorithm,http://en.wikipedia.org/wiki/Selection_algorithm On Mon, Aug 8, 2011 at 3:59 PM, nick tarunguptaa...@gmail.com wrote: how will you find the m'th maximum element in an unsorted array of integers? -- 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/-/aYU_PfGHiNkJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Re: SPOJ CENCRY
any body tell the test cases?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] amazon
okk thanx On Wed, Aug 10, 2011 at 11:58 AM, sagar pareek sagarpar...@gmail.comwrote: like u have given array *1 2 3 4 5 7* 6 7 8 9 *1 2 3 4 5 6 *5 4 3 6 7 8 ans will be 6 On Wed, Aug 10, 2011 at 11:30 AM, Anika Jain anika.jai...@gmail.comwrote: i understand longest subsequence.. but what is longest increasing subsequence .. i dont know the difference between them..plz sumbody tel .. On Tue, Aug 9, 2011 at 9:41 AM, Akash Mukherjee akash...@gmail.comwrote: @udit : thanx man...they were really helpful 2 allcan u plzz chk d answers 4 the qns : 18c,20b also how do i solve 14,16 ?? thanx On Mon, Aug 8, 2011 at 1:24 PM, Udit Gupta uditgupta...@gmail.comwrote: helloamazon's this year paper is attached with d mail cn u plz tell me what questions were there in adobe written and interviews?? On Thu, Aug 4, 2011 at 10:23 PM, Kamakshii Aggarwal kamakshi...@gmail.com wrote: Can anyone please tell what is the procedure for amazon campus recruitment? -- Regards, Kamakshi kamakshi...@gmail.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- ** Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Closest ancestor of two nodes
Don solution is perfect. i double checked it.. On Aug 9, 9:01 pm, Don dondod...@gmail.com wrote: tree closestSharedAncestor(tree root, tree node1, tree node2, int result) { tree returnValue = 0; if (root) { if (root == node1) result += 1; if (root == node2) result += 2; int sum = 0; tree returnLeft = closestSharedAncestor(root-left, node1, node2, sum); if (returnLeft) returnValuet = returnLeft; else { tree returnRight = closestSharedAncestor(root-right, node1, node2, sum); if (returnRight) returnValue = returnRight; else if (sum == 3) returnValue = root; } result += sum; } return returnValue; } On Aug 9, 9:56 am, Raman raman.u...@gmail.com wrote: Can anyone give me the recursive algo to find closest ancestor of two nodes in a tree(not a BST).- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: m'th max element
As Nitin Metioned Selection Algorithm is the best for this problem. Order of complexity is O(n) On Aug 9, 11:31 pm, Ankuj Gupta ankuj2...@gmail.com wrote: We can use min heap. 1) Build a Min Heap MH of the first m elements (arr[0] to arr[m-1]) of the given array. O(m) 2) For each element, after the mth element (arr[m] to arr[n-1]), compare it with root of MH. a) If the element is greater than the root then make it root and call heapify for MH b) Else ignore it. O((n-m)*logm) 3) Finally, MH has m largest elements and root of the MH is the mth largest element. On Aug 8, 3:57 pm, vijay goswami vjrockks...@gmail.com wrote: run bubble sort for m passes On Mon, Aug 8, 2011 at 4:02 PM, Nitin Nizhawan nitin.nizha...@gmail.comwrote: Selection algorithm,http://en.wikipedia.org/wiki/Selection_algorithm On Mon, Aug 8, 2011 at 3:59 PM, nick tarunguptaa...@gmail.com wrote: how will you find the m'th maximum element in an unsorted array of integers? -- 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/-/aYU_PfGHiNkJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: SPOJ CENCRY
3 eee cjpvbhntzgm aeiouaeiouae vfghjklwerf eouaeioicou On Wed, Aug 10, 2011 at 12:06 PM, kartik sachan kartik.sac...@gmail.comwrote: any body tell the test cases?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: SPOJ CENCRY
inp: 3 eee vfghjklwerf out: cjpvbhntzgm aeiouaeiouae eouaeioicou On Wed, Aug 10, 2011 at 12:40 PM, Nitin Nizhawan nitin.nizha...@gmail.comwrote: 3 eee cjpvbhntzgm aeiouaeiouae vfghjklwerf eouaeioicou On Wed, Aug 10, 2011 at 12:06 PM, kartik sachan kartik.sac...@gmail.comwrote: any body tell the test cases?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: SPOJ CENCRY
thanks nitin got AC...:) silliy mistake -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: m'th max element
nice logic :) -- 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/-/-rdIH5FKbk8J. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Microsoft written!!!
Agree with mohit goel.. On Wed, Aug 10, 2011 at 11:22 AM, Mohit Goel mohitgoel291...@gmail.comwrote: 10 4 5 2 7 6 11 1 39 8 12 13 14 15 i think we should first find the parent of the particular node ..then apply the concept as told by Brijesh on it p =parent(q); r = parent(p); count =1; while(p ==isright(r)) { p=r; r=parent(r); count++; if(r==root) break; } if(d =right(r)) { while(count!=0) { if(d-left) d=d-left; else d=d-right; count--; } } else return NULL; o/p=d-value; -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- With regards Puneet Chawla Computer Engineering Student NIT Kurukshetra -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Tejas networks and MAQ
Hi if anyone recently faced written or interview of those companies then pls discuss here Thanks in advance -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Microsoft written!!!
apply BFS the node after the particular node(whode cousin to be find) will be the required node On Wed, Aug 10, 2011 at 2:15 PM, Puneet Chawla puneetchawla...@gmail.comwrote: Agree with mohit goel.. On Wed, Aug 10, 2011 at 11:22 AM, Mohit Goel mohitgoel291...@gmail.comwrote: 10 4 5 2 7 6 11 1 39 8 12 13 14 15 i think we should first find the parent of the particular node ..then apply the concept as told by Brijesh on it p =parent(q); r = parent(p); count =1; while(p ==isright(r)) { p=r; r=parent(r); count++; if(r==root) break; } if(d =right(r)) { while(count!=0) { if(d-left) d=d-left; else d=d-right; count--; } } else return NULL; o/p=d-value; -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- With regards Puneet Chawla Computer Engineering Student NIT Kurukshetra -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: need the book google resume and algorithms for interviews
please share algorithm for interviews book as the link mentioned in algogeeks post does not work anymore. On Jul 26, 3:34 pm, coder dumca coder.du...@gmail.com wrote: @ Raghvendra thanks dude On Mon, Jul 25, 2011 at 7:20 PM, raghavendhra rahul rahulraghavend...@gmail.com wrote: hi , i think this s the link for algorithm for interviews ebook http://code.google.com/p/interview/downloads/detail?name=Algorithms%2... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Tejas networks and MAQ
Please anyone On Wed, Aug 10, 2011 at 2:19 PM, sagar pareek sagarpar...@gmail.com wrote: Hi if anyone recently faced written or interview of those companies then pls discuss here Thanks in advance -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Probability question.. help
is it 101/200?? On Wed, Aug 10, 2011 at 3:41 AM, Prakash D cegprak...@gmail.com wrote: is there anything like there should be atleast one man and one women should dance together? On Wed, Aug 10, 2011 at 2:26 AM, Shuaib Khan aries.shu...@gmail.comwrote: On Wed, Aug 10, 2011 at 1:45 AM, Brijesh Upadhyay brijeshupadhyay...@gmail.com wrote: No thers is not.. someone has asked me this., dont know anything else about the question :| Seems like you got half of the question there. -- 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/-/mqMvDgb6TqUJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Shuaib http://www.bytehood.com http://twitter.com/ShuaibKhan -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Microsoft written!!!
@coder dumca: If u apply DFS u will get a brother and not cousin. And yes it works only for some cases. *Muthuraj R IV th Year , ISE PESIT , Bangalore* On Wed, Aug 10, 2011 at 2:24 PM, coder dumca coder.du...@gmail.com wrote: apply BFS the node after the particular node(whode cousin to be find) will be the required node On Wed, Aug 10, 2011 at 2:15 PM, Puneet Chawla puneetchawla...@gmail.comwrote: Agree with mohit goel.. On Wed, Aug 10, 2011 at 11:22 AM, Mohit Goel mohitgoel291...@gmail.comwrote: 10 4 5 2 7 6 11 1 39 8 12 13 14 15 i think we should first find the parent of the particular node ..then apply the concept as told by Brijesh on it p =parent(q); r = parent(p); count =1; while(p ==isright(r)) { p=r; r=parent(r); count++; if(r==root) break; } if(d =right(r)) { while(count!=0) { if(d-left) d=d-left; else d=d-right; count--; } } else return NULL; o/p=d-value; -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- With regards Puneet Chawla Computer Engineering Student NIT Kurukshetra -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Microsoft written!!!
@Mohit : in ur code u are breaking out when there parent reaches root. But not every time will we have to reach root. For example: Leftmost right cousin of 1 is 9...in dat case parent should stop at 4. which is not the root. *Muthuraj R IV th Year , ISE PESIT , Bangalore* On Wed, Aug 10, 2011 at 3:26 PM, muthu raj muthura...@gmail.com wrote: @coder dumca: If u apply DFS u will get a brother and not cousin. And yes it works only for some cases. *Muthuraj R IV th Year , ISE PESIT , Bangalore* On Wed, Aug 10, 2011 at 2:24 PM, coder dumca coder.du...@gmail.comwrote: apply BFS the node after the particular node(whode cousin to be find) will be the required node On Wed, Aug 10, 2011 at 2:15 PM, Puneet Chawla puneetchawla...@gmail.com wrote: Agree with mohit goel.. On Wed, Aug 10, 2011 at 11:22 AM, Mohit Goel mohitgoel291...@gmail.comwrote: 10 4 5 2 7 6 11 1 39 8 12 13 14 15 i think we should first find the parent of the particular node ..then apply the concept as told by Brijesh on it p =parent(q); r = parent(p); count =1; while(p ==isright(r)) { p=r; r=parent(r); count++; if(r==root) break; } if(d =right(r)) { while(count!=0) { if(d-left) d=d-left; else d=d-right; count--; } } else return NULL; o/p=d-value; -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- With regards Puneet Chawla Computer Engineering Student NIT Kurukshetra -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Probability question.. help
is it 100 men 100 women? On Wed, Aug 10, 2011 at 3:25 PM, programming love love.for.programm...@gmail.com wrote: is it 101/200?? On Wed, Aug 10, 2011 at 3:41 AM, Prakash D cegprak...@gmail.com wrote: is there anything like there should be atleast one man and one women should dance together? On Wed, Aug 10, 2011 at 2:26 AM, Shuaib Khan aries.shu...@gmail.comwrote: On Wed, Aug 10, 2011 at 1:45 AM, Brijesh Upadhyay brijeshupadhyay...@gmail.com wrote: No thers is not.. someone has asked me this., dont know anything else about the question :| Seems like you got half of the question there. -- 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/-/mqMvDgb6TqUJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Shuaib http://www.bytehood.com http://twitter.com/ShuaibKhan -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] pls help
@sagar and @brijesh: awesome explanation!!! too good! 1 doubt! the question says it has only 28 leaves. According to uour explanations, it has 81 leaves. how is it possible?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Microsoft written!!!
@muthu raj: it will also come out ,when loop condition will not be statisfied.i.e when 'p' is not the right child of its parent...in such a case it will not reach root .. in the ex given by u it will stop at 4 . -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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]
can someone predict the output and give an explanation main() { int i=5; printf(%d %d %d %d %d,i++,i--,++i,--i,i); } -- *Rajeshwar Patra,* *MCA final year,* *Nit Durgapur* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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]
depends on the compiler to compiler Thank you, Siddharam On Wed, Aug 10, 2011 at 3:53 PM, Rajeshwar Patra rajeshwarpa...@gmail.comwrote: can someone predict the output and give an explanation main() { int i=5; printf(%d %d %d %d %d,i++,i--,++i,--i,i); } -- *Rajeshwar Patra,* *MCA final year,* *Nit Durgapur* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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]
can anybody explain how its printing 4 5 5 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.
Re: [algogeeks] c question!
@siddarth: should not the statement you mentioned above as nodeptr h = (nodeptr*)malloc(sizeof(nodeptr*)); be nodeptr h =(struct*)malloc(sizeof(struct)); ?? cos malloc returns pointer to memory block and nodeptr itself is a pointer and you have used nodeptr* further? On Tue, Aug 9, 2011 at 6:32 PM, siddharth srivastava akssps...@gmail.comwrote: @sidharth: thanks a lot for correcting me :) @aditya : no. there was some mistake; in the code i pasted above it's giving segmentation fault. Is it cause i'm initializing h without using malloc?? Please throw light on this problem Pointer points to a location in memory. You can't use h without making h to reference to some area in memory. And in the following code char *s; scanf(%s, s); why isn't it possible to store a string in s?? Please explain both concepts. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Siddharth Srivastava -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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]
the evaluation of parameters in printf() done from right to left. Thank you, Siddharam On Wed, Aug 10, 2011 at 4:04 PM, Anubhav Aggarwal experience...@gmail.comwrote: can anybody explain how its printing 4 5 5 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.
Re: [algogeeks] simple doubt
@jiten: that staement means pa is a pointer to 3 ints not an array of pointers.. int *pa[3] means it is an array of pointers On Fri, Aug 5, 2011 at 8:44 PM, Jiten j.playe...@gmail.com wrote: (*pa)[3] ;// pa is array of pointers to int type; so pa = arr; doesn't make any sense ,bcoz arr represents the base address of it(address of arr[0]). and pa represent the address of pa[0](which hold a pointer). I hope it's clear now -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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]
AFAIK evalution order of parameters in c is compiler dependent. On Wed, Aug 10, 2011 at 4:09 PM, siddharam suresh siddharam@gmail.com wrote: the evaluation of parameters in printf() done from right to left. Thank you, Siddharam On Wed, Aug 10, 2011 at 4:04 PM, Anubhav Aggarwal experience...@gmail.com wrote: can anybody explain how its printing 4 5 5 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. -- Cheers Naveen Kumar -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] output?
@sandeep: so the statement becomes if(ch=0) since printf returns integer 0...whats does this mean now actually?0 is ascii for NULL and so ch is assinged to null? I am slightly confused.. On Tue, Aug 9, 2011 at 7:04 PM, SANDEEP CHUGH sandeep.aa...@gmail.comwrote: @all sorry i give wrong explanation by mistake..:P :P printf() returns no if characters.. in this case returns 0 . which is assigned to ch so in ch 0 is stored and 0 is the ascii value of null character when we using ch in --- if (ch) -- it will reduce to if(0) -- as 0 is the ascii value of null character so the output it doesn't matter On Tue, Aug 9, 2011 at 10:28 PM, Dipankar Patro dip10c...@gmail.comwrote: o/p: It doesn't matter Reason: printf() returns the number of characters printed to screen. since printf() will return 0, hence the *else* is selected. On 9 August 2011 22:25, siddharth srivastava akssps...@gmail.com wrote: On 9 August 2011 22:20, tech rascal techrascal...@gmail.com wrote: #includestdio.h int main() { char ch; if((ch=printf())) printf(it matters); else printf(it doesn't matter); return 0; } It doesn't matter what will b the output?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Siddharth Srivastava -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- ___ Please do not print this e-mail until urgent requirement. Go Green!! Save Papers = Save Trees -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] pls help
It could have a maximum of 81 leaves with the same '40' no of internal nodes so for any value between 28 to 81, it would have only 40 internal nodes -- 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/-/hb7mifIIe1kJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Microsoft written!!!
thank u , i couldnot have answered this :P -- 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/-/Gppo1P-Gr9oJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] pls help
Excatly why dont u just make a rough diagram in paper for binary and ternary trees and just see that each level has max of 2/3^i where 2/3 is for binary/ternary tree and i is level where root level is 0... then make a complete ternary tree and see why leaves with 28 in numbers have internal nodes 40... just do it and then u will learn On Wed, Aug 10, 2011 at 4:58 PM, Brijesh Upadhyay brijeshupadhyay...@gmail.com wrote: It could have a maximum of 81 leaves with the same '40' no of internal nodes so for any value between 28 to 81, it would have only 40 internal nodes -- 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/-/hb7mifIIe1kJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] STL sort
I have a vector of stuct, how to sort this vector? problem is I can't overload the '' operator in struct definition, as i want to sort by 'x' one time, and then by 'y'. I tried to write the comparator function separatley but its no working. How to do it? #includeiostream #includealgorithm #includevector using namespace std; typedef struct { int x; int y; }point; struct comp_x { bool operator()(point a, point b) return a.xb.x; } struct comp_y { bool operator()(point a, point b) return a.yb.y; } int main() { vectorpoint vc; int n; cinn; point a; for(int i=0;in;i++) { cina.x; cina.y; vc.push_back(a); } coutendl; sort(vc.begin(), vc.end(), comp); for(int i=0;in;i++) { coutvc[i].x vc[i].yendl; } system(pause); return 0; } -- Regards,* Aanchal 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.
Re: [algogeeks] MS question
May be this way We dont display de title of a movie as a thumbnail So may be the first frame which has a wide distribution of colours , assuring it has some other part of de clip other than de title.. Ignore this if it sounds funny...!! On 8/9/11, *$* gopi.komand...@gmail.com wrote: I guess , it can be done using indexing , with time stamp as key , and frame pointer as data .. Please correct me if I am wrong. On Tue, Aug 9, 2011 at 11:03 PM, Priyanshu priyanshuro...@gmail.com wrote: Anyone?? Regards, Priyanshu Gupta On Fri, Aug 5, 2011 at 6:09 PM, priyanshu priyanshuro...@gmail.comwrote: Give an efficient algorithm to determine which part of the video should be displayed as a thumbnail?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Thx, --Gopi -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sent from my mobile device -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] STL sort
what is comp in your code? On Wed, Aug 10, 2011 at 6:19 PM, aanchal goyal goyal.aanch...@gmail.comwrote: I have a vector of stuct, how to sort this vector? problem is I can't overload the '' operator in struct definition, as i want to sort by 'x' one time, and then by 'y'. I tried to write the comparator function separatley but its no working. How to do it? #includeiostream #includealgorithm #includevector using namespace std; typedef struct { int x; int y; }point; struct comp_x { bool operator()(point a, point b) return a.xb.x; } struct comp_y { bool operator()(point a, point b) return a.yb.y; } int main() { vectorpoint vc; int n; cinn; point a; for(int i=0;in;i++) { cina.x; cina.y; vc.push_back(a); } coutendl; sort(vc.begin(), vc.end(), comp); for(int i=0;in;i++) { coutvc[i].x vc[i].yendl; } system(pause); return 0; } -- Regards,* Aanchal 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.
[algogeeks] Os/processor dependencies of object file(C compiled file)
Hi, I know that the compiled code of a C file(after assembler converts assembly code to opcode) cannot be run on a different OS or it cannot be run on a different processor architecture. So, I need to know what are the machine dependencies which are added in object file. One thing is the opcode will be different for each processor architecture. But how is it dependent on Operating system? -- Mithun.B.S M:9916775380 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] STL sort
sorry, comp is either comp_x or comp_y On Wed, Aug 10, 2011 at 6:24 PM, Nitin Nizhawan nitin.nizha...@gmail.comwrote: what is comp in your code? On Wed, Aug 10, 2011 at 6:19 PM, aanchal goyal goyal.aanch...@gmail.comwrote: I have a vector of stuct, how to sort this vector? problem is I can't overload the '' operator in struct definition, as i want to sort by 'x' one time, and then by 'y'. I tried to write the comparator function separatley but its no working. How to do it? #includeiostream #includealgorithm #includevector using namespace std; typedef struct { int x; int y; }point; struct comp_x { bool operator()(point a, point b) return a.xb.x; } struct comp_y { bool operator()(point a, point b) return a.yb.y; } int main() { vectorpoint vc; int n; cinn; point a; for(int i=0;in;i++) { cina.x; cina.y; vc.push_back(a); } coutendl; sort(vc.begin(), vc.end(), comp); for(int i=0;in;i++) { coutvc[i].x vc[i].yendl; } system(pause); return 0; } -- Regards,* Aanchal 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. -- Regards,* Aanchal 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.
[algogeeks] aptitude
what is the best book for aptitude questions? Shashank Jain IIIrd year Computer Engineering Delhi College of Engineering -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] aptitude
rs aggarwal On 10 August 2011 18:32, Shashank Jain shashan...@gmail.com wrote: what is the best book for aptitude questions? Shashank Jain IIIrd year Computer Engineering Delhi College of Engineering -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- regards Pratima :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] STL sort
got it. On Wed, Aug 10, 2011 at 6:31 PM, aanchal goyal goyal.aanch...@gmail.comwrote: sorry, comp is either comp_x or comp_y On Wed, Aug 10, 2011 at 6:24 PM, Nitin Nizhawan nitin.nizha...@gmail.comwrote: what is comp in your code? On Wed, Aug 10, 2011 at 6:19 PM, aanchal goyal goyal.aanch...@gmail.comwrote: I have a vector of stuct, how to sort this vector? problem is I can't overload the '' operator in struct definition, as i want to sort by 'x' one time, and then by 'y'. I tried to write the comparator function separatley but its no working. How to do it? #includeiostream #includealgorithm #includevector using namespace std; typedef struct { int x; int y; }point; struct comp_x { bool operator()(point a, point b) return a.xb.x; } struct comp_y { bool operator()(point a, point b) return a.yb.y; } int main() { vectorpoint vc; int n; cinn; point a; for(int i=0;in;i++) { cina.x; cina.y; vc.push_back(a); } coutendl; sort(vc.begin(), vc.end(), comp); for(int i=0;in;i++) { coutvc[i].x vc[i].yendl; } system(pause); return 0; } -- Regards,* Aanchal 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. -- Regards,* Aanchal Goyal*. -- Regards,* Aanchal 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.
Re: [algogeeks] pls help
@Sagar See at level 4, 81 leaf nodes are possible, since in question it has been given 28 leaf nodes, if i use just 10 nodes from level 3 (27 nodes), i can get 28 leaves, but if u observe the remaining 17 nodes in the 3rd level are also becoming leaf nodes, but in question given as 28 leaf nodes..Plz correct me. What i feel is we can have 2 cases 1) Minimum internal nodes posible If we can observe nodes pattern in each level 1 3 9 27 so in 4th level there are 27 leaf nodes, to get 28 leaf nodes, select one from 27 nodes and add 2 childs, so total leaf nodes become (27-1)+2=28 In this case, internal nodes= 1+3+9+1=14 2) maximum internal nodes in the 4th level, add one child to each node, we get 27 leaf nodes in 5th level and similarly select 1nodes in 5th level and add 2 childs to make nodes 28, now we have interal nodes= 1+3+9+27+1=41 Correct me if wrong... On 10 August 2011 05:19, sagar pareek sagarpar...@gmail.com wrote: Excatly why dont u just make a rough diagram in paper for binary and ternary trees and just see that each level has max of 2/3^i where 2/3 is for binary/ternary tree and i is level where root level is 0... then make a complete ternary tree and see why leaves with 28 in numbers have internal nodes 40... just do it and then u will learn On Wed, Aug 10, 2011 at 4:58 PM, Brijesh Upadhyay brijeshupadhyay...@gmail.com wrote: It could have a maximum of 81 leaves with the same '40' no of internal nodes so for any value between 28 to 81, it would have only 40 internal nodes -- 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/-/hb7mifIIe1kJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- With Regards, N.Vamshi Vijay, Mtech,CSE IIT Kharagpur Mobile:-07501541110 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] STL sort
bool operator()(point a, point b){ return a.xb.x; } remove references it should work. following is working code. #includeiostream #includealgorithm #includevector using namespace std; typedef struct { int x; int y; }point; struct comp_x { bool operator()(point a, point b){ return a.xb.x; } } compx; struct comp_y { bool operator()(point a, point b){ return a.yb.y; } } compy; int main() { vectorpoint vc; int n; cinn; point a; for(int i=0;in;i++) { cina.x; cina.y; vc.push_back(a); } coutendl; sort(vc.begin(), vc.end(), compx); coutBy X\n; for(int i=0;in;i++) { coutvc[i].x vc[i].yendl; } sort(vc.begin(), vc.end(), compy); coutBy Y\n; for(int i=0;in;i++) { coutvc[i].x vc[i].yendl; } return 0; } On Wed, Aug 10, 2011 at 6:31 PM, aanchal goyal goyal.aanch...@gmail.comwrote: sorry, comp is either comp_x or comp_y On Wed, Aug 10, 2011 at 6:24 PM, Nitin Nizhawan nitin.nizha...@gmail.comwrote: what is comp in your code? On Wed, Aug 10, 2011 at 6:19 PM, aanchal goyal goyal.aanch...@gmail.comwrote: I have a vector of stuct, how to sort this vector? problem is I can't overload the '' operator in struct definition, as i want to sort by 'x' one time, and then by 'y'. I tried to write the comparator function separatley but its no working. How to do it? #includeiostream #includealgorithm #includevector using namespace std; typedef struct { int x; int y; }point; struct comp_x { bool operator()(point a, point b) return a.xb.x; } struct comp_y { bool operator()(point a, point b) return a.yb.y; } int main() { vectorpoint vc; int n; cinn; point a; for(int i=0;in;i++) { cina.x; cina.y; vc.push_back(a); } coutendl; sort(vc.begin(), vc.end(), comp); for(int i=0;in;i++) { coutvc[i].x vc[i].yendl; } system(pause); return 0; } -- Regards,* Aanchal 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. -- Regards,* Aanchal 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.
Re: [algogeeks] STL sort
instead of struct you can use *pairint,int* which will make the work easier for you -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad On Wed, Aug 10, 2011 at 6:47 PM, Nitin Nizhawan nitin.nizha...@gmail.comwrote: bool operator()(point a, point b){ return a.xb.x; } remove references it should work. following is working code. #includeiostream #includealgorithm #includevector using namespace std; typedef struct { int x; int y; }point; struct comp_x { bool operator()(point a, point b){ return a.xb.x; } } compx; struct comp_y { bool operator()(point a, point b){ return a.yb.y; } } compy; int main() { vectorpoint vc; int n; cinn; point a; for(int i=0;in;i++) { cina.x; cina.y; vc.push_back(a); } coutendl; sort(vc.begin(), vc.end(), compx); coutBy X\n; for(int i=0;in;i++) { coutvc[i].x vc[i].yendl; } sort(vc.begin(), vc.end(), compy); coutBy Y\n; for(int i=0;in;i++) { coutvc[i].x vc[i].yendl; } return 0; } On Wed, Aug 10, 2011 at 6:31 PM, aanchal goyal goyal.aanch...@gmail.comwrote: sorry, comp is either comp_x or comp_y On Wed, Aug 10, 2011 at 6:24 PM, Nitin Nizhawan nitin.nizha...@gmail.com wrote: what is comp in your code? On Wed, Aug 10, 2011 at 6:19 PM, aanchal goyal goyal.aanch...@gmail.com wrote: I have a vector of stuct, how to sort this vector? problem is I can't overload the '' operator in struct definition, as i want to sort by 'x' one time, and then by 'y'. I tried to write the comparator function separatley but its no working. How to do it? #includeiostream #includealgorithm #includevector using namespace std; typedef struct { int x; int y; }point; struct comp_x { bool operator()(point a, point b) return a.xb.x; } struct comp_y { bool operator()(point a, point b) return a.yb.y; } int main() { vectorpoint vc; int n; cinn; point a; for(int i=0;in;i++) { cina.x; cina.y; vc.push_back(a); } coutendl; sort(vc.begin(), vc.end(), comp); for(int i=0;in;i++) { coutvc[i].x vc[i].yendl; } system(pause); return 0; } -- Regards,* Aanchal 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. -- Regards,* Aanchal 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.
[algogeeks] Re: pls help
is it like a number base problem? where a set of alpha is (0,1,2), and the n is the lenght of number such as (p,n) 3 (0,1) of length 3 so the value is (000)(001)(010)... On 8月10日, 下午9时19分, Amethy hobby news...@gmail.com wrote: I thought the backtracking is the method to solve this problem ,but it may not be the better one. who has the better one. On 8月5日, 下午3时02分, Gaurav Menghani gaurav.mengh...@gmail.com wrote: On Fri, Aug 5, 2011 at 12:20 PM, Kamakshii Aggarwal kamakshi...@gmail.com wrote: given a set of letters and a length N, produce all possible output.(Not permutation). For example, give the letter (p,o) and length of 3, produce the following output(in any order you want, not just my example order) ppp ppo poo pop opp opo oop ooo another example would be given (a,b) and length 2 answer: ab aa bb ba -- Regards, Kamakshi kamakshi...@gmail.com This can be done easily by backtracking void backtrack(string s, int l) { if(l == maxlen) { coutsendl; return; } s.push_back('-'); for(int i=0;ialphabet.size();i++) { s[l]=alphabet[i]; backtrack(s,l+1); } } -- Gaurav Menghani -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] C question
@ram got it. tanx :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] pls help
ya ur right!!! On 10 August 2011 18:44, vamshi vijay vamshi1...@gmail.com wrote: @Sagar See at level 4, 81 leaf nodes are possible, since in question it has been given 28 leaf nodes, if i use just 10 nodes from level 3 (27 nodes), i can get 28 leaves, but if u observe the remaining 17 nodes in the 3rd level are also becoming leaf nodes, but in question given as 28 leaf nodes..Plz correct me. What i feel is we can have 2 cases 1) Minimum internal nodes posible If we can observe nodes pattern in each level 1 3 9 27 so in 4th level there are 27 leaf nodes, to get 28 leaf nodes, select one from 27 nodes and add 2 childs, so total leaf nodes become (27-1)+2=28 In this case, internal nodes= 1+3+9+1=14 2) maximum internal nodes in the 4th level, add one child to each node, we get 27 leaf nodes in 5th level and similarly select 1nodes in 5th level and add 2 childs to make nodes 28, now we have interal nodes= 1+3+9+27+1=41 Correct me if wrong... On 10 August 2011 05:19, sagar pareek sagarpar...@gmail.com wrote: Excatly why dont u just make a rough diagram in paper for binary and ternary trees and just see that each level has max of 2/3^i where 2/3 is for binary/ternary tree and i is level where root level is 0... then make a complete ternary tree and see why leaves with 28 in numbers have internal nodes 40... just do it and then u will learn On Wed, Aug 10, 2011 at 4:58 PM, Brijesh Upadhyay brijeshupadhyay...@gmail.com wrote: It could have a maximum of 81 leaves with the same '40' no of internal nodes so for any value between 28 to 81, it would have only 40 internal nodes -- 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/-/hb7mifIIe1kJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- With Regards, N.Vamshi Vijay, Mtech,CSE IIT Kharagpur Mobile:-07501541110 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Pratima :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] problem regarding output??
@ankit: does that mean that after the compiler is informed that the void pointer will point to integer witht he typecast statement and then we point it to some other type , it will be an error? i mean after that typecast statement, if i do char a; k=a;is it wrng? On Tue, Aug 9, 2011 at 2:06 PM, ankit sambyal ankitsamb...@gmail.comwrote: The typecasting tells the compiler that the void pointer is now pointing to an integer and when we use this pointer to access the integer it takes value from 4 bytes. But when we try to increment that pointer, it will point to the next byte. Try taking k as pointer to double instead of void, u will c the same result. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] pls help
gr8 work vamshi but total nodes will be 1+3+9+27+*2*(not 1)=42 On Wed, Aug 10, 2011 at 6:59 PM, Pratz mary pratima.m...@gmail.com wrote: ya ur right!!! On 10 August 2011 18:44, vamshi vijay vamshi1...@gmail.com wrote: @Sagar See at level 4, 81 leaf nodes are possible, since in question it has been given 28 leaf nodes, if i use just 10 nodes from level 3 (27 nodes), i can get 28 leaves, but if u observe the remaining 17 nodes in the 3rd level are also becoming leaf nodes, but in question given as 28 leaf nodes..Plz correct me. What i feel is we can have 2 cases 1) Minimum internal nodes posible If we can observe nodes pattern in each level 1 3 9 27 so in 4th level there are 27 leaf nodes, to get 28 leaf nodes, select one from 27 nodes and add 2 childs, so total leaf nodes become (27-1)+2=28 In this case, internal nodes= 1+3+9+1=14 2) maximum internal nodes in the 4th level, add one child to each node, we get 27 leaf nodes in 5th level and similarly select 1nodes in 5th level and add 2 childs to make nodes 28, now we have interal nodes= 1+3+9+27+1=41 Correct me if wrong... On 10 August 2011 05:19, sagar pareek sagarpar...@gmail.com wrote: Excatly why dont u just make a rough diagram in paper for binary and ternary trees and just see that each level has max of 2/3^i where 2/3 is for binary/ternary tree and i is level where root level is 0... then make a complete ternary tree and see why leaves with 28 in numbers have internal nodes 40... just do it and then u will learn On Wed, Aug 10, 2011 at 4:58 PM, Brijesh Upadhyay brijeshupadhyay...@gmail.com wrote: It could have a maximum of 81 leaves with the same '40' no of internal nodes so for any value between 28 to 81, it would have only 40 internal nodes -- 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/-/hb7mifIIe1kJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- With Regards, N.Vamshi Vijay, Mtech,CSE IIT Kharagpur Mobile:-07501541110 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Pratima :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] pls help
@sagar: Thanks again :) But my doubt is it'll have more than 28 leaf nodes when the ques clearly sayd it shud have 28 leaf nodes. @vamshi: I kind of agree with what you say. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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]
the evalution starts from right to left bt gets printed from left to right On 10 August 2011 16:14, Naveen Kumar naveenkumarve...@gmail.com wrote: AFAIK evalution order of parameters in c is compiler dependent. On Wed, Aug 10, 2011 at 4:09 PM, siddharam suresh siddharam@gmail.com wrote: the evaluation of parameters in printf() done from right to left. Thank you, Siddharam On Wed, Aug 10, 2011 at 4:04 PM, Anubhav Aggarwal experience...@gmail.com wrote: can anybody explain how its printing 4 5 5 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. -- Cheers Naveen Kumar -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Pratima :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Preprocessor Help !!
Answer 2) To prevent use of NULL with any other variable instead of 0(zero), it is set at void pointer. for ex, you cannot use in C like this, a=b+NULL; but, i think, in C++ you can do. -- 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/-/JEkkEmJOYkkJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] pls help
I am just increasing the size of the current string by one. So that a new character can be appended. On Sat, Aug 6, 2011 at 11:01 AM, Tushar Bindal tushicom...@gmail.com wrote: @gaurav didn't get this: Just to increase the size of the string by one. Then you can put any character at the the new last position, which is 'l'. can u pls explain that? On Fri, Aug 5, 2011 at 2:57 PM, Nitin Nizhawan nitin.nizha...@gmail.com wrote: Ok, Thanks On Fri, Aug 5, 2011 at 2:53 PM, Gaurav Menghani gaurav.mengh...@gmail.com wrote: Even if the number of elements is more than two, it is possible with bitwise operations, but it gets clumsy. Suppose your alphabet has 4 characters. You can either: - Count from 0 to (14*n)-1 and use four bits to denote the selection of the alphabet. Also, only one bit amongst those four should be set. It is highly inefficient. - Keep n nested loops and inside each loop you iterate from 0 to (14)-1 and use the standard bitwise operations. The con here is that you have to hardcode the number of nested loops. On Fri, Aug 5, 2011 at 2:44 PM, Nitin Nizhawan nitin.nizha...@gmail.com wrote: @Varun I think it can be done using bits, if input character set has only two elements. Or could u plz explain? On Fri, Aug 5, 2011 at 2:29 PM, Varun Jakhoria varunjakho...@gmail.com wrote: I think it can be done using bitwise ANDing with a mask On Fri, Aug 5, 2011 at 12:58 PM, Gaurav Menghani gaurav.mengh...@gmail.com wrote: An Implementation: #includeiostream #includestring using namespace std; string alphabet; int maxlen; void backtrack(string s,int l) { if(l==maxlen) { coutsendl; return; } s.push_back('-'); for(int i=0;ialphabet.size();i++) { s[l]=alphabet[i]; backtrack(s,l+1); } } int main() { maxlen=3; alphabet=op; backtrack(,0); return 0; } On Fri, Aug 5, 2011 at 12:42 PM, Kamakshii Aggarwal kamakshi...@gmail.com wrote: @gaurav:i could not understand ur sol.can u explain it again.. On Fri, Aug 5, 2011 at 12:32 PM, Gaurav Menghani gaurav.mengh...@gmail.com wrote: On Fri, Aug 5, 2011 at 12:20 PM, Kamakshii Aggarwal kamakshi...@gmail.com wrote: given a set of letters and a length N, produce all possible output.(Not permutation). For example, give the letter (p,o) and length of 3, produce the following output(in any order you want, not just my example order) ppp ppo poo pop opp opo oop ooo another example would be given (a,b) and length 2 answer: ab aa bb ba -- Regards, Kamakshi kamakshi...@gmail.com This can be done easily by backtracking void backtrack(string s, int l) { if(l == maxlen) { coutsendl; return; } s.push_back('-'); for(int i=0;ialphabet.size();i++) { s[l]=alphabet[i]; backtrack(s,l+1); } } -- Gaurav Menghani -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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, Kamakshi kamakshi...@gmail.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Gaurav Menghani -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Varun Jakhoria ...it's only about 0's 1's -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- Gaurav Menghani -- You
[algogeeks] Re: pls help
@Nikhil: There is no way to tell how many nodes the ternary tree has. After all, a ternary tree with one leaf node can contain any number of nodes. Dave On Aug 9, 1:37 pm, NIKHIL nikhil.jain.shali...@gmail.com wrote: In a ternary Tree No of leaves 28. How many nodes it have? An AVL tree with height d. How many children it have? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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]
Its completely compiler dependent. Actually it depends upon how the printf has been implemented. Generally its a stack based implementation which will give you 4 5 5 5 5 as output. It was interesting to see your output, have you executed it ? Which compiler ? On 10 August 2011 19:05, Pratz mary pratima.m...@gmail.com wrote: the evalution starts from right to left bt gets printed from left to right On 10 August 2011 16:14, Naveen Kumar naveenkumarve...@gmail.com wrote: AFAIK evalution order of parameters in c is compiler dependent. On Wed, Aug 10, 2011 at 4:09 PM, siddharam suresh siddharam@gmail.com wrote: the evaluation of parameters in printf() done from right to left. Thank you, Siddharam On Wed, Aug 10, 2011 at 4:04 PM, Anubhav Aggarwal experience...@gmail.com wrote: can anybody explain how its printing 4 5 5 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. -- Cheers Naveen Kumar -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Pratima :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Siddharth Srivastava -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: puzzle
make two ropes 50m and 100 meter. make a loop kind of thing with that now you have two 50 mtr ropes so get down to 100 mtr point and tie loop rope in downward now cut the loop at 100 mtr you have 100 mtr rope then move down with the help of that. i hope i am clear. On Mon, Aug 8, 2011 at 1:52 PM, Shachindra A C sachindr...@gmail.comwrote: tie the rope to the peg and hold the rope at a little less than 100m point. Then jump. On Mon, Aug 8, 2011 at 1:19 PM, Himanshu Srivastava himanshusri...@gmail.com wrote: @Dave oh i thought some logical concept willl be applied in that case...it is ok!!! thanks:) On Fri, Aug 5, 2011 at 1:47 AM, Dave dave_and_da...@juno.com wrote: @Himanshu: That is easy for any boy scout. :-) Tie the rope at the top of the tower. Then tie a sheepshank knot of a comfortable length in the rope and cut the middle strand inside the knot. Climb down the rope to the peg and tie the other end of the rope onto the peg. Then, while standing on or hanging from the peg, shake the upper rope to release the sheepshank knot. The upper end will fall down and you can climb the rest of the way down. Dave On Aug 4, 1:50 pm, Himanshu Srivastava himanshusri...@gmail.com wrote: suppose u tie the rope at 200mt height and now climb down to 100m heightthen u tie the rope at that point then how will you open the rope at point above 200mt where u have tied it earlier On Thu, Aug 4, 2011 at 11:15 PM, mohit verma mohit89m...@gmail.com wrote: can't we tie the rope where we are standing (at height of 200 meter)? On Thu, Aug 4, 2011 at 10:26 PM, neeraja marathe neeraja.marath...@gmail.com wrote: this was the puzzle asked to me in NVIDIA interview: you are standing on top of a tower of ht 200 mt. .At 100 mt. ht . from bottom of tower there is a peg where u can tie a rope. You have a rope of length 150 mt. with you and using this rope you have to get down the tower. you can not jump or there is nobody to help you. how will u get down the tower?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *MOHIT VERMA* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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, Shachindra A C -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Varun Pahwa B.Tech (IT) 7th Sem. Indian Institute of Information Technology Allahabad. Ph : 09793899112 Official Email :: rit2008...@iiita.ac.in Another Email :: varunpahwa.ii...@gmail.com People who fail to plan are those who plan to fail. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] ~ operator
can someone explain how this works- * * *void* *main*(){ *int* a,b,d; scanf(%d%d,a,b); d=a+~b+1; printf(%d,d); getch(); } say if a=5 b=6 then output is -1 if ~ is one's complement operator then a=0101 ~b=1001 d= 0101+1001+1. which is not -1 can someone explain how it works. -- Regards, Ayswarya S -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: ~ operator
calculate 0101+1001+1 as Now if the signed numbers are represented using 2's complement system then is the representation for -1 On Aug 10, 7:23 pm, Ayswarya Srinivasan krsayswa...@gmail.com wrote: can someone explain how this works- * * *void* *main*(){ *int* a,b,d; scanf(%d%d,a,b); d=a+~b+1; printf(%d,d); getch(); } say if a=5 b=6 then output is -1 if ~ is one's complement operator then a=0101 ~b=1001 d= 0101+1001+1. which is not -1 can someone explain how it works. -- Regards, Ayswarya S -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: suggest simple code for
int depth(node *root) { return root ? max(depth(root-left), depth(root-right)) : 0; } On Aug 8, 8:03 am, jagrati verma jagrativermamn...@gmail.com wrote: finding the depth or height of a tree. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: suggest simple code for
int depth(node *root) { return root ? 1+max(depth(root-left), depth(root-right)) : 0; } On Aug 8, 8:03 am, jagrati verma jagrativermamn...@gmail.com wrote: finding the depth or height of a tree. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: ~ operator
@Ayswarya: In twos-complement arithmetic, -x = ~x + 1, so a + ~b + 1 = a +(~b +1) = a + (-b) = a - b. Dave On Aug 10, 9:23 am, Ayswarya Srinivasan krsayswa...@gmail.com wrote: can someone explain how this works- * * *void* *main*(){ *int* a,b,d; scanf(%d%d,a,b); d=a+~b+1; printf(%d,d); getch(); } say if a=5 b=6 then output is -1 if ~ is one's complement operator then a=0101 ~b=1001 d= 0101+1001+1. which is not -1 can someone explain how it works. -- Regards, Ayswarya S -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: suggest simple code for
@Don: Beautiful! Dave On Aug 10, 10:03 am, Don dondod...@gmail.com wrote: int depth(node *root) { return root ? 1+max(depth(root-left), depth(root-right)) : 0; } On Aug 8, 8:03 am, jagrati verma jagrativermamn...@gmail.com wrote: finding the depth or height of a tree. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: ~ operator
thank you dave and amit... On Wed, Aug 10, 2011 at 8:36 PM, Dave dave_and_da...@juno.com wrote: @Ayswarya: In twos-complement arithmetic, -x = ~x + 1, so a + ~b + 1 = a +(~b +1) = a + (-b) = a - b. Dave On Aug 10, 9:23 am, Ayswarya Srinivasan krsayswa...@gmail.com wrote: can someone explain how this works- * * *void* *main*(){ *int* a,b,d; scanf(%d%d,a,b); d=a+~b+1; printf(%d,d); getch(); } say if a=5 b=6 then output is -1 if ~ is one's complement operator then a=0101 ~b=1001 d= 0101+1001+1. which is not -1 can someone explain how it works. -- Regards, Ayswarya S -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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, Ayswarya S -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: suggest simple code for
I do love functions that start with return. Don On Aug 10, 10:09 am, Dave dave_and_da...@juno.com wrote: @Don: Beautiful! Dave On Aug 10, 10:03 am, Don dondod...@gmail.com wrote: int depth(node *root) { return root ? 1+max(depth(root-left), depth(root-right)) : 0; } On Aug 8, 8:03 am, jagrati verma jagrativermamn...@gmail.com wrote: finding the depth or height of a tree. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 question.
@Ankit Sambyal: Agree with ankuj...TC of your solution is O(nlogn) and not O(n^2)... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: m'th max element
@Ankuj: +1 for different approach. (Though selection algo is more efficient than this.) On Wed, Aug 10, 2011 at 1:44 PM, nick tarunguptaa...@gmail.com wrote: nice logic :) -- 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/-/-rdIH5FKbk8J. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Write a program to find the empirical formulae from physical formulae
Write a program to find the empirical formulae from physical formulae ex: ch3((oh)2(nh3)2)5 has empirical formulae c1 h43 o2 n10 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 question.
@kunal, anuj : step 2 of my algo takes O(n^2). So how can the TC be O(nlogn) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 question.
@Ankit: Ohh Sorry..I didnt actually read the question properly.. I didnt see we have to check for sum which must be another element in the array not some user provided constant value..I mis-understood it with sum upto k problem which can be solved on sorted array in O(n)... thats why gave a wrong comment...my Bad.. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] aptitude
what's the book name plz? Shashank Jain IIIrd year Computer Engineering Delhi College of Engineering On Wed, Aug 10, 2011 at 6:41 PM, Pratz mary pratima.m...@gmail.com wrote: rs aggarwal On 10 August 2011 18:32, Shashank Jain shashan...@gmail.com wrote: what is the best book for aptitude questions? Shashank Jain IIIrd year Computer Engineering Delhi College of Engineering -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- regards Pratima :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: thought works questions
Hi reynald can u plz post the questions u got.. On Aug 4, 6:17 am, Reynald Suz reynaldsus...@gmail.com wrote: Thank you so much! Thoughtworks is visiting our campus on Aug-8, I'll send you questions for sure. On Wed, Aug 3, 2011 at 11:14 PM, coder dumca coder.du...@gmail.com wrote: hi reynald i m sending u some question that i have. thought workd is gooing to visit our campys in few days . if it is visiting ur campus befire us then pls send me the questions. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Reynald Reni Masters in Software Engineering CIT - India -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] aptitude
**http://www.jbigdeal.com/2010/08/r-s-agarwal-quantitative-aptitude-e.htmlQuantitative Apptitude By R S Agarwal On Wed, Aug 10, 2011 at 10:49 PM, Shashank Jain shashan...@gmail.comwrote: what's the book name plz? Shashank Jain IIIrd year Computer Engineering Delhi College of Engineering On Wed, Aug 10, 2011 at 6:41 PM, Pratz mary pratima.m...@gmail.comwrote: rs aggarwal On 10 August 2011 18:32, Shashank Jain shashan...@gmail.com wrote: what is the best book for aptitude questions? Shashank Jain IIIrd year Computer Engineering Delhi College of Engineering -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- regards Pratima :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- . *Thanks Best regards* ** ** *Rajoo kumar kannaujiya* *Pursuing M.Tech(cse)* *Motilal Nehru National Institute of Technology,* *Allahabad.* *Contect No. : 8090842100* *Email : rajoo...@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.
[algogeeks] c output
main() { int m,n; m=3+max(2,3); n=2*max(3,2); printf(“%d,%d”,m,n); } ans:-m=2,n=3 why output is 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.
Re: [algogeeks] c output
this ques has been answered be4 on this grp...and u missed the macro definition as welljst a few days bak...search the group On Wed, Aug 10, 2011 at 11:00 PM, rohit rajuljain...@gmail.com wrote: main() { int m,n; m=3+max(2,3); n=2*max(3,2); printf(“%d,%d”,m,n); } ans:-m=2,n=3 why output is 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. -- Aditi Garg Undergraduate Student Electronics Communication Divison NETAJI SUBHAS INSTITUTE OF TECHNOLOGY Sector 3, Dwarka New Delhi -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: EMC question paper pattern
is your interview over??? On Aug 9, 11:31 pm, nandy nandhini.scor...@gmail.com wrote: Hi all,does anyone know EMC software's(bangalore) written pattern?is it purely technical..if so can anyone tell me the areas to concentrate on? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] aptitude
is it sufficient or do we need to refer to any other books? On Wed, Aug 10, 2011 at 10:59 PM, rajoo king without sing rajoo...@gmail.com wrote: **http://www.jbigdeal.com/2010/08/r-s-agarwal-quantitative-aptitude-e.htmlQuantitative Apptitude By R S Agarwal On Wed, Aug 10, 2011 at 10:49 PM, Shashank Jain shashan...@gmail.comwrote: what's the book name plz? Shashank Jain IIIrd year Computer Engineering Delhi College of Engineering On Wed, Aug 10, 2011 at 6:41 PM, Pratz mary pratima.m...@gmail.comwrote: rs aggarwal On 10 August 2011 18:32, Shashank Jain shashan...@gmail.com wrote: what is the best book for aptitude questions? Shashank Jain IIIrd year Computer Engineering Delhi College of Engineering -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- regards Pratima :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- . *Thanks Best regards* ** ** *Rajoo kumar kannaujiya* *Pursuing M.Tech(cse)* *Motilal Nehru National Institute of Technology,* *Allahabad.* *Contect No. : 8090842100* *Email : rajoo...@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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: puzzle
Tie the rope at the top of the tower Climb down with the help of the rope up to 100 mt peg possItion Tie the rope to that peg, Climb up to the top of the tower with that rope. Now release the rope at the top and hold it. It ll take you down.:P On Wed, Aug 10, 2011 at 7:49 PM, varun pahwa varunpahwa2...@gmail.comwrote: make two ropes 50m and 100 meter. make a loop kind of thing with that now you have two 50 mtr ropes so get down to 100 mtr point and tie loop rope in downward now cut the loop at 100 mtr you have 100 mtr rope then move down with the help of that. i hope i am clear. On Mon, Aug 8, 2011 at 1:52 PM, Shachindra A C sachindr...@gmail.comwrote: tie the rope to the peg and hold the rope at a little less than 100m point. Then jump. On Mon, Aug 8, 2011 at 1:19 PM, Himanshu Srivastava himanshusri...@gmail.com wrote: @Dave oh i thought some logical concept willl be applied in that case...it is ok!!! thanks:) On Fri, Aug 5, 2011 at 1:47 AM, Dave dave_and_da...@juno.com wrote: @Himanshu: That is easy for any boy scout. :-) Tie the rope at the top of the tower. Then tie a sheepshank knot of a comfortable length in the rope and cut the middle strand inside the knot. Climb down the rope to the peg and tie the other end of the rope onto the peg. Then, while standing on or hanging from the peg, shake the upper rope to release the sheepshank knot. The upper end will fall down and you can climb the rest of the way down. Dave On Aug 4, 1:50 pm, Himanshu Srivastava himanshusri...@gmail.com wrote: suppose u tie the rope at 200mt height and now climb down to 100m heightthen u tie the rope at that point then how will you open the rope at point above 200mt where u have tied it earlier On Thu, Aug 4, 2011 at 11:15 PM, mohit verma mohit89m...@gmail.com wrote: can't we tie the rope where we are standing (at height of 200 meter)? On Thu, Aug 4, 2011 at 10:26 PM, neeraja marathe neeraja.marath...@gmail.com wrote: this was the puzzle asked to me in NVIDIA interview: you are standing on top of a tower of ht 200 mt. .At 100 mt. ht . from bottom of tower there is a peg where u can tie a rope. You have a rope of length 150 mt. with you and using this rope you have to get down the tower. you can not jump or there is nobody to help you. how will u get down the tower?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *MOHIT VERMA* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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, Shachindra A C -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Varun Pahwa B.Tech (IT) 7th Sem. Indian Institute of Information Technology Allahabad. Ph : 09793899112 Official Email :: rit2008...@iiita.ac.in Another Email :: varunpahwa.ii...@gmail.com People who fail to plan are those who plan to fail. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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, $hr!k@nth -- You received this message because you are subscribed to the Google Groups
[algogeeks] Problems on Linked List
Q1)Two linked Lists are given,i.e,their head pointers are given,and the problem is to check if the second one is reverse of the first one.Give the most efficient algo for it. Q2)A linked list is given,and one of its nodes is given.The problem is to delete the given node from the linked list.(The head node is not given). (In both of the above cases,the linked lists are singly linked lists.) -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Problems on Linked List
for first reverse one of the link list by changing the pointer and than traverse one from backward and compare it the the other. for second. keep copying data from the next node to the node to be delete and remove the tail. This will not work if node to be deleted is the last node. On Wed, Aug 10, 2011 at 11:44 PM, Piyush Kapoor pkjee2...@gmail.com wrote: Q1)Two linked Lists are given,i.e,their head pointers are given,and the problem is to check if the second one is reverse of the first one.Give the most efficient algo for it. Q2)A linked list is given,and one of its nodes is given.The problem is to delete the given node from the linked list.(The head node is not given). (In both of the above cases,the linked lists are singly linked lists.) -- Regards, Piyush Kapoor, 2nd year,CSE IT-BHU -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Naveen Kumar -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Problems on Linked List
@naveen for the first one,how will u traverse the list backwards.. I didnt understand your second solution,since the head is not given so how can u go from a node to the node to be deleted.. I forgot that in the first one,we are not allowed to use extra memory. Also do please mention the time complexity of your solutions.. On Wed, Aug 10, 2011 at 11:54 PM, Naveen Kumar naveenkumarve...@gmail.comwrote: for first reverse one of the link list by changing the pointer and than traverse one from backward and compare it the the other. for second. keep copying data from the next node to the node to be delete and remove the tail. This will not work if node to be deleted is the last node. On Wed, Aug 10, 2011 at 11:44 PM, Piyush Kapoor pkjee2...@gmail.com wrote: Q1)Two linked Lists are given,i.e,their head pointers are given,and the problem is to check if the second one is reverse of the first one.Give the most efficient algo for it. Q2)A linked list is given,and one of its nodes is given.The problem is to delete the given node from the linked list.(The head node is not given). (In both of the above cases,the linked lists are singly linked lists.) -- Regards, Piyush Kapoor, 2nd year,CSE IT-BHU -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Naveen Kumar -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] goldman sachs paper
can anyone please post the questions asked in goldman sachs this year -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Problems on Linked List
reverse the list inplace and compare the two list element by element On Thu, Aug 11, 2011 at 12:01 AM, Piyush Kapoor pkjee2...@gmail.com wrote: @naveen for the first one,how will u traverse the list backwards.. I didnt understand your second solution,since the head is not given so how can u go from a node to the node to be deleted.. I forgot that in the first one,we are not allowed to use extra memory. Also do please mention the time complexity of your solutions.. On Wed, Aug 10, 2011 at 11:54 PM, Naveen Kumar naveenkumarve...@gmail.com wrote: for first reverse one of the link list by changing the pointer and than traverse one from backward and compare it the the other. for second. keep copying data from the next node to the node to be delete and remove the tail. This will not work if node to be deleted is the last node. On Wed, Aug 10, 2011 at 11:44 PM, Piyush Kapoor pkjee2...@gmail.com wrote: Q1)Two linked Lists are given,i.e,their head pointers are given,and the problem is to check if the second one is reverse of the first one.Give the most efficient algo for it. Q2)A linked list is given,and one of its nodes is given.The problem is to delete the given node from the linked list.(The head node is not given). (In both of the above cases,the linked lists are singly linked lists.) -- Regards, Piyush Kapoor, 2nd year,CSE IT-BHU -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Naveen Kumar -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] goldman sachs paper
+1 to deepika. On Thu, Aug 11, 2011 at 12:10 AM, deepikaanand swinyanand...@gmail.comwrote: can anyone please post the questions asked in goldman sachs this year -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Prashant Gupta B.Tech Final Year Computer Science and Engineering NIT Trichy Phone : +91 9894462744 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Plz tell wat questions are asked by MICROSOFT IDC and IT both...Plz Reply fast.....anyone...!!
-- 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/-/dV-k5A2L7PkJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Problems on Linked List
Ques 1: Let l1 and l2 be the 2 lists. Step 1 : Reverse l1 O(n) Step 2 : Compare l1 and l2 by comparing each node and traversing ahead.--O(n) Step 3: Reverse l1 -O(n) Ques 2: Let cur be the node of the linked list which is to be deleted. LinkedList temp=cur-next; cur-data=temp-data; cur-next=temp-next; free(temp); TC : O(1) This solution does not work if cur is the last node of the link list. In that case u will have to traverse the whole link list and TC will be O(n) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Problems on Linked List
and for second no need to delete that very node pointer, take the data of the node next to the node you want to delete and copy that to the node you want to delete, do it for all next nodes. delete the last node. On Thu, Aug 11, 2011 at 12:12 AM, sukran dhawan sukrandha...@gmail.com wrote: reverse the list inplace and compare the two list element by element On Thu, Aug 11, 2011 at 12:01 AM, Piyush Kapoor pkjee2...@gmail.com wrote: @naveen for the first one,how will u traverse the list backwards.. I didnt understand your second solution,since the head is not given so how can u go from a node to the node to be deleted.. I forgot that in the first one,we are not allowed to use extra memory. Also do please mention the time complexity of your solutions.. On Wed, Aug 10, 2011 at 11:54 PM, Naveen Kumar naveenkumarve...@gmail.com wrote: for first reverse one of the link list by changing the pointer and than traverse one from backward and compare it the the other. for second. keep copying data from the next node to the node to be delete and remove the tail. This will not work if node to be deleted is the last node. On Wed, Aug 10, 2011 at 11:44 PM, Piyush Kapoor pkjee2...@gmail.com wrote: Q1)Two linked Lists are given,i.e,their head pointers are given,and the problem is to check if the second one is reverse of the first one.Give the most efficient algo for it. Q2)A linked list is given,and one of its nodes is given.The problem is to delete the given node from the linked list.(The head node is not given). (In both of the above cases,the linked lists are singly linked lists.) -- Regards, Piyush Kapoor, 2nd year,CSE IT-BHU -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Naveen Kumar -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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, Piyush Kapoor, 2nd year,CSE IT-BHU -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Naveen Kumar -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] aptitude
please help me ! On Wed, Aug 10, 2011 at 11:20 PM, sukran dhawan sukrandha...@gmail.comwrote: is it sufficient or do we need to refer to any other books? On Wed, Aug 10, 2011 at 10:59 PM, rajoo king without sing rajoo...@gmail.com wrote: **http://www.jbigdeal.com/2010/08/r-s-agarwal-quantitative-aptitude-e.htmlQuantitative Apptitude By R S Agarwal On Wed, Aug 10, 2011 at 10:49 PM, Shashank Jain shashan...@gmail.comwrote: what's the book name plz? Shashank Jain IIIrd year Computer Engineering Delhi College of Engineering On Wed, Aug 10, 2011 at 6:41 PM, Pratz mary pratima.m...@gmail.comwrote: rs aggarwal On 10 August 2011 18:32, Shashank Jain shashan...@gmail.com wrote: what is the best book for aptitude questions? Shashank Jain IIIrd year Computer Engineering Delhi College of Engineering -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- regards Pratima :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- . *Thanks Best regards* ** ** *Rajoo kumar kannaujiya* *Pursuing M.Tech(cse)* *Motilal Nehru National Institute of Technology,* *Allahabad.* *Contect No. : 8090842100* *Email : rajoo...@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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Microsoft Written Test Questions
hey...is your written test over...plz share the questions dude...!! plz.. -- 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/-/PWtdOw902rIJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Problems on Linked List
1)similar to list palindrome problem(soln already there in net) 2)it has discussed 2 day before on same group. please search once Thank you, Siddharam On Thu, Aug 11, 2011 at 12:01 AM, Piyush Kapoor pkjee2...@gmail.com wrote: @naveen for the first one,how will u traverse the list backwards.. I didnt understand your second solution,since the head is not given so how can u go from a node to the node to be deleted.. I forgot that in the first one,we are not allowed to use extra memory. Also do please mention the time complexity of your solutions.. On Wed, Aug 10, 2011 at 11:54 PM, Naveen Kumar naveenkumarve...@gmail.com wrote: for first reverse one of the link list by changing the pointer and than traverse one from backward and compare it the the other. for second. keep copying data from the next node to the node to be delete and remove the tail. This will not work if node to be deleted is the last node. On Wed, Aug 10, 2011 at 11:44 PM, Piyush Kapoor pkjee2...@gmail.com wrote: Q1)Two linked Lists are given,i.e,their head pointers are given,and the problem is to check if the second one is reverse of the first one.Give the most efficient algo for it. Q2)A linked list is given,and one of its nodes is given.The problem is to delete the given node from the linked list.(The head node is not given). (In both of the above cases,the linked lists are singly linked lists.) -- Regards, Piyush Kapoor, 2nd year,CSE IT-BHU -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Naveen Kumar -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Microsoft Written Test Questions
Yeah...please share questions..it will be of a lot help! -- 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/-/cs4XYfgJrooJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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]
how to find the mirror image of a binary tree ? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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:
It's an UNDEFINED BEHAVIOR . -- 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/-/sydSwA_UuWQJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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]
at each node swap left right pointers On Thu, Aug 11, 2011 at 12:25 AM, sukran dhawan sukrandha...@gmail.com wrote: how to find the mirror image of a binary tree ? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Naveen Kumar -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Problems on Linked List
thanks all On Thu, Aug 11, 2011 at 12:21 AM, siddharam suresh siddharam@gmail.comwrote: 1)similar to list palindrome problem(soln already there in net) 2)it has discussed 2 day before on same group. please search once Thank you, Siddharam On Thu, Aug 11, 2011 at 12:01 AM, Piyush Kapoor pkjee2...@gmail.comwrote: @naveen for the first one,how will u traverse the list backwards.. I didnt understand your second solution,since the head is not given so how can u go from a node to the node to be deleted.. I forgot that in the first one,we are not allowed to use extra memory. Also do please mention the time complexity of your solutions.. On Wed, Aug 10, 2011 at 11:54 PM, Naveen Kumar naveenkumarve...@gmail.com wrote: for first reverse one of the link list by changing the pointer and than traverse one from backward and compare it the the other. for second. keep copying data from the next node to the node to be delete and remove the tail. This will not work if node to be deleted is the last node. On Wed, Aug 10, 2011 at 11:44 PM, Piyush Kapoor pkjee2...@gmail.com wrote: Q1)Two linked Lists are given,i.e,their head pointers are given,and the problem is to check if the second one is reverse of the first one.Give the most efficient algo for it. Q2)A linked list is given,and one of its nodes is given.The problem is to delete the given node from the linked list.(The head node is not given). (In both of the above cases,the linked lists are singly linked lists.) -- Regards, Piyush Kapoor, 2nd year,CSE IT-BHU -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Naveen Kumar -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Write a program to find the empirical formulae from physical formulae
i think the given formula's solution should be c1 h33 o20 n10 check the question.. On Wed, Aug 10, 2011 at 9:49 PM, vikas mehta...@gmail.com wrote: Write a program to find the empirical formulae from physical formulae ex: ch3((oh)2(nh3)2)5 has empirical formulae c1 h43 o2 n10 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] goldman sachs paper
+1.. it'll be helpful On Thu, Aug 11, 2011 at 12:12 AM, Prashant Gupta prashantatn...@gmail.comwrote: +1 to deepika. On Thu, Aug 11, 2011 at 12:10 AM, deepikaanand swinyanand...@gmail.comwrote: can anyone please post the questions asked in goldman sachs this year -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Prashant Gupta B.Tech Final Year Computer Science and Engineering NIT Trichy Phone : +91 9894462744 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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]
void mirror(struct node* node) { if (node==NULL) { return; } else { struct node* temp; mirror(node-left); mirror(node-right); temp = node-left; node-left = node-right; node-right = temp; } } -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Problems on Linked List
1)for the fst one you dont have to reverse the linked list just traverse the linked list recursively and read it from back . correct me if m wrong ! On Thu, Aug 11, 2011 at 12:41 AM, Piyush Kapoor pkjee2...@gmail.com wrote: thanks all On Thu, Aug 11, 2011 at 12:21 AM, siddharam suresh siddharam@gmail.com wrote: 1)similar to list palindrome problem(soln already there in net) 2)it has discussed 2 day before on same group. please search once Thank you, Siddharam On Thu, Aug 11, 2011 at 12:01 AM, Piyush Kapoor pkjee2...@gmail.comwrote: @naveen for the first one,how will u traverse the list backwards.. I didnt understand your second solution,since the head is not given so how can u go from a node to the node to be deleted.. I forgot that in the first one,we are not allowed to use extra memory. Also do please mention the time complexity of your solutions.. On Wed, Aug 10, 2011 at 11:54 PM, Naveen Kumar naveenkumarve...@gmail.com wrote: for first reverse one of the link list by changing the pointer and than traverse one from backward and compare it the the other. for second. keep copying data from the next node to the node to be delete and remove the tail. This will not work if node to be deleted is the last node. On Wed, Aug 10, 2011 at 11:44 PM, Piyush Kapoor pkjee2...@gmail.com wrote: Q1)Two linked Lists are given,i.e,their head pointers are given,and the problem is to check if the second one is reverse of the first one.Give the most efficient algo for it. Q2)A linked list is given,and one of its nodes is given.The problem is to delete the given node from the linked list.(The head node is not given). (In both of the above cases,the linked lists are singly linked lists.) -- Regards, Piyush Kapoor, 2nd year,CSE IT-BHU -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Naveen Kumar -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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.