Hash Tables:Buckets, Collisions, and When `HashMap` Lies About O(1)
How hashing maps a key to a bucket, what chaining and open addressing do with collisions, and why HashMap is expected O(1) — not a law of physics.
Read MorePosts May 2026
30 posts
How hashing maps a key to a bucket, what chaining and open addressing do with collisions, and why HashMap is expected O(1) — not a law of physics.
Read MoreA double-ended queue lets you push and pop at both ends in O(1). How ArrayDeque delivers that in the JDK, and when a deque is a stack, a queue, or a sliding window.
Read MoreFIFO as an ADT: enqueue, dequeue, and why a naive array queue slides or wastes space — and how a circular buffer (ring) fixes both.
Read MoreHands-on dmesg recipes for everyday work — inspect boot messages, chase hardware faults, filter by level, and watch the kernel live.
Read MoreLIFO as an ADT: push, pop, peek, and why undo, brace matching, and the call stack are the same layout — implemented with ArrayDeque, not java.util.Stack.
Read MoreHow node-and-pointer lists make splice cheap when you already hold the node, why get(i) walks, and how singly, doubly, and circular variants differ.
Read MoreHow ArrayList grows by doubling, why append is amortized O(1) not a guarantee on the next call, and when a fixed array is the honest choice.
Read MoreHands-on top, htop, and btop recipes — read load averages, find CPU and memory hogs, and triage a busy box in real time.
Read MoreHow a contiguous array makes index i O(1), why insert and delete in the middle slide everything, and how a 2D matrix is still the same layout.
Read MoreA beginner-to-advanced path through data structures: glossary, Big-O literacy, a JDK map, and a living index of every post in this series.
Read MoreJava 15 text blocks (JEP 378): triple-quote multiline strings, incidental indentation, and escape sequences — JSON, SQL, and HTML without + concatenation.
Read MoreJava 14 switch expressions (JEP 361): arrow cases, yield, exhaustiveness — return a value without fall-through breaks. Pattern switch lives in a later post.
Read MoreHands-on find recipes for everyday work — hunt by name, type, size, and time, then act on matches with confidence.
Read MoreUse Java 11 java.net.http.HttpClient for HTTP/1.1 and HTTP/2 — builder, sync and async send, body handlers — without Apache HttpClient or OkHttp for ordinary calls.
Read MoreJava 10 var (JEP 286): use local-variable type inference when the right-hand side already names the type, and skip it when var hides what the reader needs.
Read MoreWhat JPMS (JEP 261) actually buys: explicit exports, requires, and a smaller runtime — not a file you copy into every repo. import module is a later language convenience.
Read MoreCompose async Java work with CompletableFuture — supplyAsync, thenApply, thenCompose, allOf — without nested callbacks, and when virtual threads are the simpler path.
Read MoreReplace Calendar and SimpleDateFormat with java.time — Instant, LocalDate, ZonedDateTime, formatting, and a Clock you can fake in tests.
Read MoreHands-on awk recipes for everyday work — pick columns, filter rows, change separators, and compute totals in pipelines.
Read MoreUse java.util.Optional to return absence without null — of/ofNullable, map/flatMap/filter, orElse vs orElseGet, and when wrapping every call is cargo-cult.
Read MoreUse java.util.function’s primitive SAM grid to skip boxing on hot numeric paths, fill IntStream slots, and leave ToIntFunction out of ordinary application code.
Read MoreUse BiFunction, BiPredicate, and BiConsumer for two-argument slots — apply, test, accept — and fill Map.merge, compute, and forEach without inventing a pair type.
Read MoreHands-on grep recipes for everyday work — find text, filter logs, search codebases, and pipe results with confidence.
Read MoreUse UnaryOperator and BinaryOperator when input and output are the same type — List.replaceAll, Stream.reduce, Collectors.reducing, and minBy / maxBy.
Read MoreUse Java’s Supplier<T> for lazy values — get, orElseGet, factories, supplyAsync — so you do not build work until something actually needs the result.
Read MoreUse Java’s Consumer<T> for side effects — accept, andThen — and see where Stream.forEach, Optional.ifPresent, and peek already ask for it.
Read MoreUse Java’s Predicate<T> to test values — test, and, or, negate, isEqual, Predicate.not (Java 11) — and see where Stream.filter, anyMatch, and removeIf already ask for it.
Read MoreLearn the Linux filesystem hierarchy — what /, /etc, /var, /usr, /home and friends are for, and when to look in each one.
Read MoreUse Java’s Function<T,R> to map values — apply, compose, andThen, identity — and see where Stream.map, Optional.map, and Collectors already ask for it.
Read MoreWhat a Java functional interface is, the four shapes in java.util.function, when to write your own SAM type, and a living map of every post in this series.
Read More