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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kengo TODA
August 20, 2012
Technology
2
120
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.7k
ヒューマンスキル / The Humanskills
eller86
0
730
医療機関向けシステムの信頼性 / Reliability of systems for medical institutions
eller86
0
490
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.4k
Java8〜16におけるバイトコード生成の変化 / Changes of Bytecode Generation from Java 8 to 16
eller86
4
4.6k
Other Decks in Technology
See All in Technology
データの整合性を保ちたいだけなんだ
shoheimitani
8
3.1k
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
620
2026年、サーバーレスの現在地 -「制約と戦う技術」から「当たり前の実行基盤」へ- /serverless2026
slsops
2
250
会社紹介資料 / Sansan Company Profile
sansan33
PRO
15
400k
AWS Network Firewall Proxyを触ってみた
nagisa53
1
230
こんなところでも(地味に)活躍するImage Modeさんを知ってるかい?- Image Mode for OpenShift -
tsukaman
0
140
Amazon S3 Vectorsを使って資格勉強用AIエージェントを構築してみた
usanchuu
3
450
ZOZOにおけるAI活用の現在 ~開発組織全体での取り組みと試行錯誤~
zozotech
PRO
5
5.5k
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
5
1.6k
コスト削減から「セキュリティと利便性」を担うプラットフォームへ
sansantech
PRO
3
1.5k
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
450
CDK対応したAWS DevOps Agentを試そう_20260201
masakiokuda
1
290
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Building Adaptive Systems
keathley
44
2.9k
Utilizing Notion as your number one productivity tool
mfonobong
3
220
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.9k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
110
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.6k
Visualization
eitanlees
150
17k
The World Runs on Bad Software
bkeepers
PRO
72
12k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
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>