随笔分类 -  leetcode_heap

摘要:You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k. Define a pair (u,v) which consists of one element from th 阅读全文
posted @ 2017-10-25 17:08 daniel456 阅读(93) 评论(0) 推荐(0) 编辑
摘要:Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For exam 阅读全文
posted @ 2017-10-25 16:46 daniel456 阅读(88) 评论(0) 推荐(0) 编辑
摘要:You are given an integer array sorted in ascending order (may contain duplicates), you need to split them into several subsequences, where each subseq 阅读全文
posted @ 2017-10-25 16:26 daniel456 阅读(170) 评论(0) 推荐(0) 编辑
摘要:Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix. Note that it is th 阅读全文
posted @ 2017-10-24 15:16 daniel456 阅读(207) 评论(0) 推荐(0) 编辑
摘要: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 the u 阅读全文
posted @ 2017-10-24 11:41 daniel456 阅读(166) 评论(0) 推荐(0) 编辑
摘要: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]. Note: You may assum 阅读全文
posted @ 2017-10-24 10:34 daniel456 阅读(79) 评论(0) 推荐(0) 编辑
摘要:Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Example 2: Example 3: 阅读全文
posted @ 2017-10-23 21:51 daniel456 阅读(117) 评论(0) 推荐(0) 编辑
摘要:Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 阅读全文
posted @ 2017-10-19 11:48 daniel456 阅读(114) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示