From b124befd1263689d1078a3417cd10cbf5ce2aebe Mon Sep 17 00:00:00 2001 From: chenhaoran14 <2718827494@qq.com> Date: Thu, 20 Jan 2022 01:15:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9Java=E7=9A=84=E5=A4=A7=E9=A1=B6?= =?UTF-8?q?=E5=A0=86=E5=92=8C=E5=B0=8F=E9=A1=B6=E5=A0=86=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E4=BA=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0347.前K个高频元素.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/0347.前K个高频元素.md b/problems/0347.前K个高频元素.md index 0b8fd2d7..8bd774e9 100644 --- a/problems/0347.前K个高频元素.md +++ b/problems/0347.前K个高频元素.md @@ -142,7 +142,7 @@ class Solution { Set> entries = map.entrySet(); // 根据map的value值正序排,相当于一个小顶堆 - PriorityQueue> queue = new PriorityQueue<>((o1, o2) -> o2.getValue() - o1.getValue()); + PriorityQueue> queue = new PriorityQueue<>((o1, o2) -> o1.getValue() - o2.getValue()); for (Map.Entry entry : entries) { queue.offer(entry); if (queue.size() > k) {