@sravanreddy: it won't work. Try 3,91,9 and 90,1,8,2,5 . correct me if i m wrong.
Thanks, Ankit Sambyal On Sat, May 28, 2011 at 9:16 PM, ross <[email protected]> wrote: > @sravanreddy: > Hey, Nice Solution :) cool! > > On May 29, 7:44 am, sravanreddy001 <[email protected]> wrote: > > Maintain a pointer A_end = m-1; > > doing a comparision something similar to merge sort > > > > int i=0;j=0; > > while (i< m){ > > if (a[i] < b[j]) > > i++; > > else{ > > swap(a[A_end],b[j]) > > A_end --; > > j++; > > } > > > > } > > > > This runs in O(m) time and no extra space, also the sort order is not > > guarenteed. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
