you can use mean heap like this

you can take all the first element of  array & construct mean heap

now delete the root element(let A) & add it in sorted element

take the next element from the array which A was belonging to & add it in
the heap & heappify it again

& repeat the process till you find the Heap is not having anymore element


On Fri, Mar 25, 2011 at 1:36 PM, bittu <[email protected]> wrote:

> Given k sorted arrays each of length n, construct a single merged and
> sorted array.focus on running time and space complexity
>
> my soln. 1st basic soln..simple merge sort all whet we does in merging
> 2 sorted array it too complex for  big K
> 2nd i have approach using min-heap as well but not able to figure the
> working code ..dono why?
>
>  lets c what others think
>
> Approach & Exactness of The Solution matters here
>
>
> Thanks
> Shashank
>
> --
> 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.
>
>


-- 
~~~~black d!amond~~~~~~~~

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