I think it can be proved by contradiction that there does not exist a better sorting algorithm than O(mnlogmn) because if there is one then that means we can sort an array better than O(nlgn) by assuming an array as 2D array of k rows and Ceiling(n/k) columns.
and if the elements belongs to some range then it may be useful to use Counting or Radix sort depending upon the range On Sat, Sep 24, 2011 at 11:24 PM, siddharth srivastava <[email protected]>wrote: > Is the range of numbers provided ? > > > On 24 September 2011 10:26, teja bala <[email protected]> wrote: > >> What is the efficient way to sort a M*N matrix. >> >> eg: Given a 3*4 matrix >> >> 2 6 7 12 >> 11 8 5 1 >> 9 3 4 10 >> >> The ouput should be >> >> 1 2 3 4 >> 5 6 7 8 >> 9 10 11 12 >> >> Matrix may contain duplicates.. >> >> -- >> 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. >> >> > > > -- > 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 [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. > -- Sunny Aggrawal B.Tech. V year,CSI Indian Institute Of Technology,Roorkee -- 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.
