Consider a Array of N x N For example take 3 X 3 Since the array is sorted by row and column , sort all the array elements by reading it in zig-zag order.
for example 5 8 9 6 10 13 11 15 17 can be read as 5 6 8 9 10 11 13 15 17 by chechking whether the row or column entry contains smaller number when reading in zig zag order. After the two given N x N array are sorted , merge the two using sorted outputs Take the first N of final merged sorted array and arrange it in zig azg order It contains the least N^2 elements from the two given array and the median is the centre element ie.,(N/2,N.2) of the array --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---