List、Set、Queue => Collection (Collections: methods)
Map
Introduction
- ArrayList:搜尋佳
- LinkedList:插入、刪除佳
- Stack:FILO (push、pop)
Set:元素不可重複
TreeSet:使用者自訂排序
HashSet:快速取出、無序
LinkedHashSet:存放順序與新增時相同
- Queue:FIFO (offer、poll)
Stack、Queue 之 peek() 方法用來檢視,不會刪除
- Map:key-value 型態
- HashMap : 插入刪除速度快
- TreeMap : 有序