Oops, there's a bug in my analysis! the sort complexity is even better at O(N) :)
If you're doing K merges of subarrays of size O( N / K ) (which is the worst case for this algo due to the merge cost of O(min{N, M}) ) using the reverse operation you've supplied, the result is an O(N) sort instead of an O(N log N) sort. Win! :) -- DK http://twitter.com/divyekapoor http://www.divye.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/-/B3UaUlMO4jwJ. 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.