Finding kth smallest number from n sorted arrays

后端 未结 8 1148
谎友^
谎友^ 2020-12-02 06:31

So, you have n sorted arrays (not necessarily of equal length), and you are to return the kth smallest element in the combined array (i.e the combined array formed by mergin

8条回答
  •  执笔经年
    2020-12-02 07:07

    There exist an generalization that solves the problem in O(N log k) time, see the question here.

提交回复
热议问题