Yours approach is good to get answer.
>From my best understanding
yours algorithm will take 1^2 + 2^2 + 3^2 + ..... + N^2 + (N-1)^2 +
.....+ 1^2
to place all array into 1D array. which evaluates to O(N^3) with O(N^2)
space storage.

                  Actually there is an idea to take every element from
2nd 2D array
and insert it into the 1st by replacing the biggest element of all i.e
at (N-1,N-1) element and do the heapify (as this type of array can be
assumed as a heap).  This algorithm works in O(N^3)(i.e O(N^2)*O(N)(for
heapify)) with no extra storage.
My intension is to optimize this.!

The first problem is the subproblem to 2nd one. The median is not
(N/2,N/2) as for example

             1   2   3   10 11 12
             4   5   6   13 14 15
             7   8   9   16 17 18<--median
             19 20 21 22 23 24
             25 26 27 28 29 30
             31 32 33 34 35 36

         Of course it cannot be median always....generally the median
lies
in lower left part and higher right part of the square..

Thats it from me...


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

Reply via email to