Hi Varun,
Are there any restrictions on k1, k2, k3 ... ?
If not Just choose k_i = a_i i=1,2,..,n. :-)
-Thanks
Bujji
On Sat, Mar 23, 2013 at 7:23 AM, Varun <[email protected]> wrote:
> Hello all,
>
> I have this problem to solve, and seek your assistance.
>
> Program should be feeded with following integer inputs.
> 1. n integers in ascending order (a1,a2,a3...an)
> 2 an integer K.
>
> We need to find K(k1,k2...kn) integers between [a1..an] both inclusive
> such that the sum of the absolute value of the difference of nearest ai
> and ki is minimum.
>
> I know dynamic programming should be used here, but not able to figure out
> the correct way of doing it.
> Any insights.
>
> Thnx.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].