2015年3月27日

第501篇随笔

摘要: 突然发现自己从前年到现在刚好两年的时间里,已经写了500篇随笔。虽然有一部分是从网上down下来的,不过很多都还是自己的code。纪念一下。。。 阅读全文

posted @ 2015-03-27 11:08 Step-BY-Step 阅读(119) 评论(0) 推荐(0) 编辑

implement min heap

摘要: 1 class MinHeap{ 2 private ArrayList arr; 3 private int DEFAULT_LEN = 10; 4 public MinHeap(){ 5 arr = new ArrayList(DEFAULT_LEN);... 阅读全文

posted @ 2015-03-27 11:01 Step-BY-Step 阅读(249) 评论(0) 推荐(0) 编辑

find K maximum value from an unsorted array(implement min heap)

摘要: Maintain a min-heap with size = k, to collect the result. 1 //Find K minimum values from an unsorted array 2 //Implement Min-Heap 3 4 public int[] fi... 阅读全文

posted @ 2015-03-27 09:50 Step-BY-Step 阅读(254) 评论(0) 推荐(0) 编辑

导航