It depends upon problem

if n << m, apply insertion sort for sorting m arrays because for
smaller sublists insertion sort perform better then merge sort and
then merge them all in mnlog(m)

otherwise simply combine and apply merge sort or any other standard
sorting algorithm

On Sat, Jul 16, 2011 at 9:30 PM, Dave <[email protected]> wrote:
> @Aseem: Combine the arrays and sort the result. O(mn log mn).
>
> Dave
>
> On Jul 16, 4:13 am, aseem garg <[email protected]> wrote:
>> Q2. Given m arrays of n size each, give an algorithm to combine these arrays
>> into a single array with sorted elements. Also tell the time complexity of
>> your solution.
>> Aseem
>
> --
> 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.
>
>



-- 
Sanjay Ahuja,
Analyst, Financing Prime Brokerage
Nomura Securities India Pvt. Ltd

-- 
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.

Reply via email to