摘要: 为啥current==2时不++,而current==0时候却要++呢? 等于0的时候,考虑到从左往右遍历,从begin处换过来的数不可能是0,也不可能是2,只能是1,故current++; 但是与end交换时,末尾的数却可能是2,所以不++,要进行下一轮比较。 阅读全文
posted @ 2019-03-15 23:00 Nice_to_see_you 阅读(252) 评论(0) 推荐(0) 编辑
摘要: python 版方法1:链表 采用sorted()函数对多维数组按照其中某一维进行排序参见:http://www.runoob.com/python/python-func-sorted.html python 版方法2:top K之最小堆实现 https://mp.weixin.qq.com/s? 阅读全文
posted @ 2019-03-15 21:58 Nice_to_see_you 阅读(228) 评论(0) 推荐(0) 编辑