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
2
130
collections in JDK (beta)
To explain the basic collection in JDK
Kengo TODA
August 20, 2012
Tweet
Share
More Decks by Kengo TODA
See All by Kengo TODA
生成AI 業務応用向けガイドライン 斜め読み / Overview of Generative AI Business Application Guidelines
eller86
0
160
KotlinユーザのためのJSpecify入門 / JSpecify 101 for Kotlin Devs
eller86
0
1.9k
JavaとGroovyで書かれたGradleプラグインをKotlinで書き直した話 / Converted a Gradle plugin from Groovy&Java to Kotlin
eller86
0
1.8k
ヒューマンスキル / The Humanskills
eller86
0
740
医療機関向けシステムの信頼性 / Reliability of systems for medical institutions
eller86
0
500
Server-side Kotlinを使うスタートアップでどんなDetektルールが育ったか / Detekt rules made in start-up working with Server-side Kotlin
eller86
0
1.6k
Java開発者向けのKotlin Gradleビルドスクリプト入門 / Gradle Build Script in Kotlin 101
eller86
1
2.1k
Goodbye JSR305, Hello JSpecify!
eller86
2
5.5k
Java8〜16におけるバイトコード生成の変化 / Changes of Bytecode Generation from Java 8 to 16
eller86
4
4.6k
Other Decks in Technology
See All in Technology
【社内勉強会】新年度からコーディングエージェントを使いこなす - 構造と制約で引き出すClaude Codeの実践知
nwiizo
27
13k
TUNA Camp 2026 京都Stage ヒューリスティックアルゴリズム入門
terryu16
0
590
Embeddings : Symfony AI en pratique
lyrixx
0
380
来期の評価で変えようと思っていること 〜AI時代に変わること・変わらないこと〜
estie
0
110
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
11k
OpenClawでPM業務を自動化
knishioka
1
310
「通るまでRe-run」から卒業!落ちないテストを書く勘所
asumikam
2
810
MIX AUDIO EN BROADCAST
ralpherick
0
120
脳が溶けた話 / Melted Brain
keisuke69
1
1.1k
韓非子に学ぶAI活用術
tomfook
3
1.1k
私がよく使うMCPサーバー3選と社内で安全に活用する方法
kintotechdev
0
130
イベントで大活躍する電子ペーパー名札を作る(その2) 〜 M5PaperとM5PaperS3 〜 / IoTLT @ JLCPCB オープンハードカンファレンス
you
PRO
0
210
Featured
See All Featured
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
90
Abbi's Birthday
coloredviolet
2
5.9k
My Coaching Mixtape
mlcsv
0
86
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
470
The Cult of Friendly URLs
andyhume
79
6.8k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
64
54k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.2k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
160
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Tell your own story through comics
letsgokoyo
1
870
Design in an AI World
tapps
0
180
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>