Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
collections in JDK (beta)
Search
Kengo TODA
August 20, 2012
Technology
140
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
collections in JDK (beta)
To explain the basic collection in JDK
Kengo TODA
August 20, 2012
More Decks by Kengo TODA
See All by Kengo TODA
Kotlin 開発のツラミを爆破した話! / Explode the difficulty of Kotlin dev!
eller86
0
180
生成AI 業務応用向けガイドライン 斜め読み / Overview of Generative AI Business Application Guidelines
eller86
0
210
KotlinユーザのためのJSpecify入門 / JSpecify 101 for Kotlin Devs
eller86
0
2.2k
JavaとGroovyで書かれたGradleプラグインをKotlinで書き直した話 / Converted a Gradle plugin from Groovy&Java to Kotlin
eller86
0
1.9k
ヒューマンスキル / The Humanskills
eller86
0
770
医療機関向けシステムの信頼性 / Reliability of systems for medical institutions
eller86
0
540
Server-side Kotlinを使うスタートアップでどんなDetektルールが育ったか / Detekt rules made in start-up working with Server-side Kotlin
eller86
0
1.7k
Java開発者向けのKotlin Gradleビルドスクリプト入門 / Gradle Build Script in Kotlin 101
eller86
1
2.2k
Goodbye JSR305, Hello JSpecify!
eller86
2
5.6k
Other Decks in Technology
See All in Technology
TypeScript入門 2026
recruitengineers
PRO
3
580
FPGAが実現する遠方宇宙の高空間分解能天体撮影 -大型地上望遠鏡の視力を補正する「補償光学」とは?-
komei_mt
0
240
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
19k
Flutterをカメラで動かしたかった話
sony
1
140
グローバル基準のSREは、運用現場でどう機能したか:成熟度アセスメントの実践 / SRE NEXT 2026
sorawatanabe
0
230
【CEDEC2026】次世代デジタルカードゲームのサーバー設計と運用 〜『Shadowverse: Worlds Beyond』の舞台裏~
cygames
PRO
1
1.3k
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
4.9k
FDEの心得
noriakioji
4
5.7k
Genie Codeハンズオン基礎編
taka_aki
1
120
【CEDEC2026】『ウマ娘 プリティーダービー』 英語版のキャラクターの方言や口調をローカライズするための創造的アプローチ
cygames
PRO
2
830
モバイルアプリ開発概論2026
recruitengineers
PRO
5
590
【Google Cloud Next Tokyo'26】Gemini Enterprise と Oracle AI Database で実現する、業務データ活用を実現する AI エージェント実装
shisyu_gaku
0
250
Featured
See All Featured
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
200
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
73
41k
Between Models and Reality
mayunak
4
390
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
340
Context Engineering - Making Every Token Count
addyosmani
9
1k
Believing is Seeing
oripsolob
1
190
Leo the Paperboy
mayatellez
8
2.1k
Transcript
collections in JDK - basic data structures you should know
- 2012/Aug/29 Kengo TODA
Basic collection List<T> Set<T> Map<K, T>
ArrayList<T> It just wraps an array Good to #get(int): O(1)
Bad to #remove(int), #contains(T) : O(n)
LinkedList<T> Simple bidirectional list It costs more Java heap than
ArrayList Good to #remove(0), #add(0, T): O(1) Bad to #get(int), #contains(T) : O(n)
How to choose? ArrayList: Stack When we needs random access
LinkedList: Queue (Deque) When we call #remove(int) frequently
HashMap<K, V> It use hash table to manage key We
have to implement #hashCode() correctly It does not implement SortedMap interface
TreeMap<K, V> It use red-black tree to manage key We
have to implement Comparable or Comparator correctly It implements SortedMap
LinkedHashMap<K, V> A subclass of HashMap It has bidirectional list
to memory insertion- order (or access-order) It does not implement SortedMap interface
How to choose? HashMap Standard use TreeMap When we have
to use ordering LinkedHashMap When we have to memory insertion-order
Set ≒ Map HashSet TreeSet LinkedHashSet
Legacy implementations Vector Stack Hashtable Properties @Deprecated
Additional collection Google guava contains useful collections Table<C, R, V>
Multiset<T> Multimap<K, V>