摘要: 这道题一看其实可以使用最大堆的方式来完成。使用最大堆来解决本题的时间复杂度为:o(mn*log(k)),这样虽然很巧妙,但是由于还乘上了logk的缘故时间反而慢了。因此我们可以直接通过直接对这个二维数组lists进行遍历,这样就可以得到一个sorted的数组。因此使用sort这个函数,也就是快速排序 阅读全文
posted @ 2021-06-28 16:04 Geeksongs 阅读(36) 评论(0) 推荐(0) 编辑

Coded by Geeksongs on Linux

All rights reserved, no one is allowed to pirate or use the document for other purposes.