cynorr

Learn what I touched.

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  Java

摘要:###摘要--- 1、STL的map底层是用红黑树实现的,查找时间复杂度是log(n); 2、STL的hash_map底层是用hash表存储的,查询时间复杂度是O(1); 3、什么时候用map,什么时候用hash_map? 这个要看具体的应用,不一定常数级别的hash_map... 阅读全文
posted @ 2015-04-23 21:14 cynorr 阅读(264) 评论(0) 推荐(0)

摘要:### Map can't be sorted by valueMap can't be sorted by value , so that we can change map to *List* and then sort the list .###Collections.sort( List l... 阅读全文
posted @ 2015-04-23 21:03 cynorr 阅读(192) 评论(0) 推荐(0)

摘要:###why comparator ?* comparable : adj* comparator : nSome class can't be changed , which like Map , Set and their subclass . They are given being unch... 阅读全文
posted @ 2015-04-23 21:02 cynorr 阅读(194) 评论(0) 推荐(0)

摘要:###1.add \ remove \ sort```import java.util.ArrayList;import java.util.Collections;import java.util.Comparator;public class listTest{ public static vo... 阅读全文
posted @ 2015-04-23 21:01 cynorr 阅读(136) 评论(0) 推荐(0)

摘要:###entrySet() , values() and keySet()```import java.util.Iterator;import java.util.Map.Entry;import java.util.TreeMap;public class mapTest{ public sta... 阅读全文
posted @ 2015-04-23 21:00 cynorr 阅读(140) 评论(0) 推荐(0)

摘要:### 简介中大型Java项目普遍需要调配许多参数,本文引入参数包,用系统快捷的方法管理参数。效果如下:```Poster [options...] [arguments...] -dictFile VAL : Specify file of dictionary -filterLemm... 阅读全文
posted @ 2015-04-22 18:22 cynorr 阅读(359) 评论(0) 推荐(0)