Top K and Quick Selection

摘要: The common solutions for top k problem are heap (priority queue) and quick selection. Using heap is very straight-forward, while quick selection with 阅读全文
posted @ 2016-11-22 02:37 kkkiii 阅读(372) 评论(0) 推荐(0)

Understand and use PriorityQueue

摘要: Implementation PriorityQueue http://www.voidcn.com/blog/u012881904/article/p-5985172.html Time complexity: Insert (Object): O(logn) Add to last locati 阅读全文
posted @ 2016-10-24 10:38 kkkiii 阅读(200) 评论(0) 推荐(0)

One sequence DP problems

摘要: 1. Climbing stairs easiest one shot [TO DO] 2. Jump game [TO DO] 3. Jump game II [TO DO] 4. Palindrome Partitioning II (https://leetcode.com/problems/ 阅读全文
posted @ 2016-10-23 01:47 kkkiii 阅读(163) 评论(0) 推荐(0)

Backpack Problems

摘要: 1. Backpack I Given n items with size Ai, an integer m denotes the size of a backpack. How full you can fill this backpack? (http://www.lintcode.com/e 阅读全文
posted @ 2016-10-13 11:10 kkkiii 阅读(178) 评论(0) 推荐(0)