Re: [algogeeks] Directi Interview Ques
how would you solve it then On Wednesday, July 11, 2012 2:53:26 AM UTC+5:30, Mr.B wrote: I think you missed the question: Its a stable merge. (order of elements in each array should be same) Sorting will destroy the original order. Thanks, Mr.B [Please include complexities and pseudo-code] On Tuesday, 10 July 2012 16:18:04 UTC-4, Akshat wrote: Here you have to first sort both the arrays A and B and merge both the arrays to form the sorted array C -- Akshat Sapra Under Graduation(B.Tech) IIIT-Allahabad(Amethi Campus) *--* sapraaks...@gmail.com akshatsapr...@gmail.com rit20009008@ rit20009...@gmail.comiiita.ac.in -- 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/-/mBt7Y0hzUL0J. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Directi Interview Ques
i guess this algo would work... 1.scan the two array a and b from the end say the indexs be i j respectively for the two arrays 2.compare the elements a[i] with b[j] if a[i]b[j] include b[j] j-- else if a[i]b[j] then include a[i] j-- else if recursively findin reducing which index would serve better { consider the case a[]={1,2,3,3,3,4} ,b[]={3,3,3,6,7,8 }; when coming to index i=4 and j=2 educing j is beneficial } iterate through step 2 until one of the array ends.and then include the remaining elements of the other non empty array On Fri, Jul 13, 2012 at 1:35 AM, sumit991 sumitphulkan...@gmail.com wrote: how would you solve it then On Wednesday, July 11, 2012 2:53:26 AM UTC+5:30, Mr.B wrote: I think you missed the question: Its a stable merge. (order of elements in each array should be same) Sorting will destroy the original order. Thanks, Mr.B [Please include complexities and pseudo-code] On Tuesday, 10 July 2012 16:18:04 UTC-4, Akshat wrote: Here you have to first sort both the arrays A and B and merge both the arrays to form the sorted array C -- Akshat Sapra Under Graduation(B.Tech) IIIT-Allahabad(Amethi Campus) *--* sapraaks...@gmail.com akshatsapr...@gmail.com rit20009008@ rit20009...@gmail.comiiita.ac.in -- 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/-/mBt7Y0hzUL0J. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Directi Interview Ques
@abinesh: The solution given has a very very high complexity. as it finds all possiblilities and tests each one of it. is it *n*[(2n!)/(n! * n!)]* -- This is exponential solution. I am not sure but, there must be a DP solution to this . --Sravan Reddy On Wed, Jul 11, 2012 at 12:15 AM, arumuga abinesh arumugaabin...@gmail.comwrote: http://www.geeksforgeeks.org/archives/17743 Using the above problem we get all possible merges , at each possible merge, we can calculate the sum. On 7/11/12, Mr.B sravanreddy...@gmail.com wrote: I think you missed the question: Its a stable merge. (order of elements in each array should be same) Sorting will destroy the original order. Thanks, Mr.B [Please include complexities and pseudo-code] On Tuesday, 10 July 2012 16:18:04 UTC-4, Akshat wrote: Here you have to first sort both the arrays A and B and merge both the arrays to form the sorted array C -- Akshat Sapra Under Graduation(B.Tech) IIIT-Allahabad(Amethi Campus) *--* sapraaks...@gmail.com akshatsapr...@gmail.com rit20009008@ rit20009...@gmail.comiiita.ac.in -- 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/-/uCRLEzDBWAAJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Directi Interview Ques
Here you have to first sort both the arrays A and B and merge both the arrays to form the sorted array C -- Akshat Sapra Under Graduation(B.Tech) IIIT-Allahabad(Amethi Campus) *--* sapraaks...@gmail.com akshatsapr...@gmail.com rit20009008@ rit20009...@gmail.comiiita.ac.in -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Directi Interview Ques
I think you missed the question: Its a stable merge. (order of elements in each array should be same) Sorting will destroy the original order. Thanks, Mr.B [Please include complexities and pseudo-code] On Tuesday, 10 July 2012 16:18:04 UTC-4, Akshat wrote: Here you have to first sort both the arrays A and B and merge both the arrays to form the sorted array C -- Akshat Sapra Under Graduation(B.Tech) IIIT-Allahabad(Amethi Campus) *--* sapraaks...@gmail.com akshatsapr...@gmail.com rit20009008@ rit20009...@gmail.comiiita.ac.in -- 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/-/uCRLEzDBWAAJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Directi Interview Ques
http://www.geeksforgeeks.org/archives/17743 Using the above problem we get all possible merges , at each possible merge, we can calculate the sum. On 7/11/12, Mr.B sravanreddy...@gmail.com wrote: I think you missed the question: Its a stable merge. (order of elements in each array should be same) Sorting will destroy the original order. Thanks, Mr.B [Please include complexities and pseudo-code] On Tuesday, 10 July 2012 16:18:04 UTC-4, Akshat wrote: Here you have to first sort both the arrays A and B and merge both the arrays to form the sorted array C -- Akshat Sapra Under Graduation(B.Tech) IIIT-Allahabad(Amethi Campus) *--* sapraaks...@gmail.com akshatsapr...@gmail.com rit20009008@ rit20009...@gmail.comiiita.ac.in -- 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/-/uCRLEzDBWAAJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Directi Interview Ques
pls discuss about prilims, online coding round too !! regards, Karthikeyan.M On 7/11/12, arumuga abinesh arumugaabin...@gmail.com wrote: http://www.geeksforgeeks.org/archives/17743 Using the above problem we get all possible merges , at each possible merge, we can calculate the sum. On 7/11/12, Mr.B sravanreddy...@gmail.com wrote: I think you missed the question: Its a stable merge. (order of elements in each array should be same) Sorting will destroy the original order. Thanks, Mr.B [Please include complexities and pseudo-code] On Tuesday, 10 July 2012 16:18:04 UTC-4, Akshat wrote: Here you have to first sort both the arrays A and B and merge both the arrays to form the sorted array C -- Akshat Sapra Under Graduation(B.Tech) IIIT-Allahabad(Amethi Campus) *--* sapraaks...@gmail.com akshatsapr...@gmail.com rit20009008@ rit20009...@gmail.comiiita.ac.in -- 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/-/uCRLEzDBWAAJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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.