How to find the minimum sum of range of k partitions of an array of size n?

那年仲夏 提交于 2019-12-12 02:19:09

问题


There is an array A of size n. We are given the number of partitions k. How to find the minimum sum of range of all partitions? Range is difference between maximum and mimimum element in that partition. For eg. A={20, 30, 40, 41, 45}, k = 4. The minimum possible sum of range of all partitions is 1.

来源:https://stackoverflow.com/questions/40188492/how-to-find-the-minimum-sum-of-range-of-k-partitions-of-an-array-of-size-n

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!