摘要: topk问题是一个十分经典的问题,解决该问题主要有两种思路。 第一种是利用 堆 结构,讲解:https://www.cnblogs.com/chengxiao/p/6129630.html 第二种是利用 快速排序 先回顾一下实现堆结构的代码: package LCtest.com; import j 阅读全文
posted @ 2020-06-04 23:18 yawenw 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 1.判断最简分数gcd函数 class Solution { public List<String> simplifiedFractions(int n) { List<String> res = new ArrayList<>(); for(int molecule = 1; molecule < 阅读全文
posted @ 2020-06-04 10:53 yawenw 阅读(175) 评论(0) 推荐(0) 编辑