Home:ALL Converter>Selecting top n items from multiple sorted arrays

Selecting top n items from multiple sorted arrays

Ask Time:2018-09-01T01:39:01         Author:Bertram Gilfoyle

Json Formatter

What is the optimal algorithm for selecting top n elements from multiple arrays, provided each array is sorted the same way in which the resultant array should be.

Reading elements is very expensive and therefore the number of reads should be an absolute minimum.

Author:Bertram Gilfoyle,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/52120393/selecting-top-n-items-from-multiple-sorted-arrays
yy