On Fri, Sep 18, 2009 at 6:20 PM, Mangal Dev Gupta <[email protected]>wrote:
> @mittal
> I am not able to understand ..... How are you updating the C
> array?......You didnt tell what will be the updated array after second
> element?....Please elaborate...
>
>
> Size of array C is same as that of X, i.e. n.
It contains the indices of array Y, with whom the elements of X are to be
summed and all the values compared to find the minimum.
At mth iteration, the required smallest element corresponding to array Z,
Z[m] = min { X[i] + Y[C[i]] }, 0<=i<n,
The i for which, the minimum occurs, update C[i] = C[i]+1.
In the proposed algorithm, searching for minimum element is done using min
heap.
--
Shishir Mittal
Ph: +91 9936 180 121
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---