how would you sort n sorted lists with average length K in O(n*log K) time?

前端 未结 4 942
伪装坚强ぢ
伪装坚强ぢ 2020-12-21 17:57

how would you sort n sorted lists with average length K in O(n*log K) time?

4条回答
  •  伪装坚强ぢ
    2020-12-21 18:57

    You can adapt merge sort to do the job. Merge sort takes advantage of the ease of merging already sorted lists into a new sorted list.

提交回复
热议问题