Skip to main content

Binary Tree Traversals in Java: Inorder, Preorder, Postorder and Level Order (Recursive and Iterative)

Binary tree traversal in Java on one numbered nine-node tree: recursive and iterative inorder, preorder and postorder with stack dry-run tables, one-stack postorder, Morris traversal, level order and zigzag with a queue, height, an O(n) versus O(n squared) diameter comparison by counted visits, a real StackOverflowError on a one-million-node skewed tree, and exam questions with answers.

sun.misc.Unsafe Memory Access Is Going Away: Find and Fix It in Your Dependencies

JDK 25 already prints a warning when a library calls sun.misc.Unsafe memory-access methods, and JEP 471 plans for them to throw and then disappear. What each --sun-misc-unsafe-memory-access value does on JDK 25, how jdeps, a bytecode scan and JFR find the callers in real jars (Netty, Guava, Kryo, Hadoop, Cassandra, Protobuf and more), and CAS, off-heap and byte[] code migrated to VarHandle and the FFM API with a before/after equivalence test.