@problem owner Have you posted the correct question? Because this does not seems like a trivial question which someone can ask in the middle of an interview. I found a similar question while googling. It reads:
"There are two sorted arrays A1 and A2. Array A1 is full where as array A2 is partially empty and number of empty slots are just enough to accommodate all elements of A1. Write a program to merge the two sorted arrays to fill the array A2. You cannot use any additional memory and expected run time is O(n)" Check this link: http://www.technicalinterviewquestions.net/2009/01/merge-sorted-arrays-empty-slots.html On Jul 8, 12:03 pm, Jitendra Kushwaha <jitendra.th...@gmail.com> wrote: > @souravsain > Consider your algo for the case > int arr[] = {10,20,30,40,50,23,27}; > > everytime when you increment the j you are missing on element i.e j-1 for > further comparison > > -- > Regards > Jitendra Kushwaha > MNNIT, Allahabad -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.