Finding least difference between max and min value of all possible sets of numbers

Revision en1, by NODE_SM, 2022-07-20 15:06:48

There are n arrays of k size each. a0[0],a0[1],......a0[k-1] a1[0],a1[1],......a1[k-1] . . . an-1[0],an-1[1], .... an-1[k-1] Now a Set of size n is constructed by taking any value randomly from each of the arrays. e.g one such set can be {a0[0],a1[3],a2[2],.... an-1[k-1]} My goal is to find out the min and max elements in all possible Sets such that the difference between the min and max is the lowest.

Tags minheap, 2d arrays, dynamic programming

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English NODE_SM 2022-07-20 15:07:39 808
en1 English NODE_SM 2022-07-20 15:06:48 499 Initial revision (published)