![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
优先队列
文章平均质量分 80
小榕流光
这个作者很懒,什么都没留下…
展开
-
[leetcode] 347. Top K Frequent Elements 解题报告
题目链接:https://leetcode.com/problems/top-k-frequent-elements/Given a non-empty array of integers, return the k most frequent elements.For example,Given [1,1,1,2,2,3] and k = 2, return [1,2].原创 2016-05-02 11:47:25 · 2566 阅读 · 0 评论 -
[leetcode] 23. Merge k Sorted Lists 解题报告
题目链接:https://leetcode.com/problems/merge-k-sorted-lists/Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.思路:刚开始想要两两合并,但是超时了,后来看到用优先队列来做会降低很原创 2016-01-10 10:23:12 · 712 阅读 · 0 评论 -
[leetcode] 378. Kth Smallest Element in a Sorted Matrix 解题报告
题目链接: https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element i原创 2016-08-20 15:43:59 · 4425 阅读 · 1 评论 -
[leetcode] 355. Design Twitter 解题报告
题目链接:https://leetcode.com/problems/design-twitter/Design a simplified version of Twitter where users can post tweets, follow/unfollow another user and is able to see the 10 most recent tweets in原创 2016-06-15 08:13:51 · 2491 阅读 · 0 评论 -
[leetcode] 295. Find Median from Data Stream 解题报告
题目链接: https://leetcode.com/problems/find-median-from-data-stream/Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median i原创 2016-03-30 14:18:42 · 3463 阅读 · 0 评论 -
[leetcode] 407. Trapping Rain Water II 解题报告
题目链接:https://leetcode.com/problems/trapping-rain-water-ii/Given an m x n matrix of positive integers representing the height of each unit cell in a 2D elevation map, compute the volume of wate原创 2016-09-29 06:25:11 · 5847 阅读 · 3 评论