技巧:
如何判断这些容器的数据结构?
通过每一个容器的名称即可明确其数据结构:
ArrayList: 数组 array。
LinkedList: 链表:link。
HashSet: 哈希表:hash。
TreeSet: 二叉树:tree。
HashMap: 哈希表。hash。
TreeMap: 二叉树。tree。
看到array,就要想到角标。
看到link,就要想到first,last。
看到hash,就要想到hashCode,equals.
看到tree,就要想到两个接口。Comparable,Comparator。
map是一个双列集合,collection 是一个单列几个,map是键值对存储,