Skip to content
SparkTime, home

Tagged #data structures

GuideTechnology

12 min read

Ordering, Queues and Choosing a Collection

How to sort objects with Comparable and Comparator, how queues, deques and priority queues work, why ArrayDeque replaces the legacy Stack, and a decision guide with complexity and memory trade-offs for choosing the right collection.

GuideTechnology

14 min read

Maps and How HashMap Works

How Java stores key-value pairs, and how HashMap finds a value in constant time: hashing, buckets, collisions, resizing and treeification, explained with a small map you build yourself. Plus LinkedHashMap, TreeMap, the everyday Map methods, and the mistakes that corrupt a map.