Tagged articles
Red-Black Tree
44 articles · Page 1 of 1

liandkSep 5, 2026 · Fundamentals
This tutorial explains Red-Black Trees, comparing them with AVL trees, detailing their five properties, three fix operations (recolor, left/right rotations), providing a Python implementation, and covering real-world uses in Java HashMap, Linux kernel, and databases, plus selection guidelines and common pitfalls.
AVL TreeData StructuresHashMap
0 likes · 10 min read

HashMap is not a simple key‑value store but an array‑based scheduling system that uses a three‑step put process, hash perturbation, bit‑wise indexing, and conditional conversion of long bucket lists into red‑black trees, with resize mechanics that can become performance bottlenecks in high‑concurrency Java applications.
ConcurrencyData StructuresHashMap
0 likes · 8 min read

This article explains the inner workings of Linux's epoll mechanism, detailing how red‑black trees manage registered file descriptors and how a ready‑list delivers events in O(1) time, covering core APIs, data structures, insertion‑deletion logic, and the full kernel‑space to user‑space flow.
EpollLinuxRed-Black Tree
0 likes · 54 min read

This article explains the mechanisms Java’s HashMap uses to handle hash collisions, covering the initial perturbation function, the transition from linked‑list chaining to red‑black tree conversion, the differences between Java 7 and Java 8 implementations, and the resizing logic that mitigates conflict.
HashMapJavaRed-Black Tree
0 likes · 17 min read

Java’s HashMap tackles hash collisions through a combination of perturbation functions, chaining, open addressing, and, since JDK 8, converting long chains into red‑black trees, with detailed explanations of the underlying algorithms, resizing mechanics, threshold choices, and performance trade‑offs for developers and interview candidates.
HashMapJavaRed-Black Tree
0 likes · 17 min read

epoll, Linux’s high-performance I/O multiplexing mechanism, outperforms select and poll by leveraging a red-black tree to manage file descriptors, offering O(log n) registration, O(1) event retrieval, and scalable handling of millions of connections, with detailed explanations of its architecture, workflow, and performance advantages.
EpollI/O multiplexingLinux
0 likes · 10 min read

This article explains the internal architecture of Java's HashMap, covering its array of buckets, linked‑list handling of hash collisions, and the conversion to red‑black trees for high‑collision scenarios, supplemented with code examples and visual diagrams.
HashMapJavaLinked List
0 likes · 5 min read

This article systematically explains epoll's core data structures—including a red‑black tree and a doubly linked ready list—its three main APIs, the kernel implementation details, thread‑safety mechanisms, ET vs. LT behavior, and how it improves over select/poll for high‑concurrency network programming.
EpollI/O multiplexingLinux kernel
0 likes · 68 min read


LouZaiJan 29, 2024 · Interview Experience
This article systematically explains epoll’s internal data structures, how the protocol stack notifies it, the locking strategy for thread safety, the differences between edge‑triggered and level‑triggered modes, and why it outperforms select/poll in high‑concurrency Linux I/O.
EpollI/O multiplexingLinux
0 likes · 13 min read

This article explores the classic implementation of red‑black trees, comparing them with AVL trees, detailing their 2‑3‑4 tree correspondence, and walking through Java TreeMap insertion and deletion algorithms, including node definitions, rotation cases, and rebalancing procedures, while analyzing their time complexities.
AVL TreeAlgorithmData Structures
0 likes · 20 min read

This article explains the evolution of tree-based index structures—from basic binary search trees through AVL and red‑black trees to B‑trees and B+‑trees—highlighting their trade‑offs and why MySQL adopts B+‑trees for efficient disk‑based indexing.
AVLB+ TreeB-Tree
0 likes · 10 min read

This article explains how Java's HashMap stores key‑value pairs using an array‑plus‑linked‑list structure, details the hash function, index calculation, collision handling, resizing, and the conditions under which linked lists are replaced by red‑black trees, illustrated with concrete code examples.
CollisionHashMapRed-Black Tree
0 likes · 20 min read

This article explains the internal structure of Java's HashMap and ConcurrentHashMap, covering hash calculation, bucket handling, load factor, resizing, collision resolution with linked lists and red‑black trees, and the differences in thread‑safety and performance between these map implementations.
ConcurrencyConcurrentHashMapHashMap
0 likes · 12 min read

This article explains Java HashMap's internal structure, including the array‑linked list and red‑black tree design, load factor, collision resolution methods, resizing process, key selection, thread‑safety concerns, and the hash calculation algorithm, providing detailed insights for developers.
HashMapJDKJava
0 likes · 17 min read

This article provides a comprehensive overview of fundamental data structures and algorithms, covering basic concepts, complexity analysis, case studies, and detailed examinations of structures such as HashMap, Bloom filter, SkipList, AVL, Red‑Black, B+Tree, and HashTree, while discussing their advantages, disadvantages, and typical use cases.
AVL TreeComplexityData Structures
0 likes · 23 min read

This article explains the fundamentals and structures of database indexes—including binary trees, red‑black trees, B‑Tree, B+Tree, hash indexes—and details how MySQL’s InnoDB and MyISAM engines implement clustered and non‑clustered indexes, covering their characteristics, storage files, and query behavior.
B+ TreeDatabase IndexesInnoDB
0 likes · 9 min read

This article dissects Java’s HashMap implementation, covering lazy initialization, the put workflow, hash mixing, bucket conversion to red‑black trees, core helper methods, removal logic, thread‑safety considerations, and practical usage tips, all illustrated with source excerpts.
ConcurrencyHashMapJava
0 likes · 31 min read

This article explains red‑black trees, covering their definition, properties, relationship to 2‑3 trees, balance guarantees, time‑complexity analysis, and step‑by‑step insertion algorithms with rotations and color flips.
2-3 TreeAlgorithm ComplexityBalanced BST
0 likes · 12 min read

This article walks through the fundamentals of red‑black trees, explains their equivalence to 2‑3‑4 trees, details insertion and deletion algorithms, and shares practical debugging techniques to help readers implement and understand this complex balanced binary search tree.
2-3-4 TreeAlgorithmBalancing
0 likes · 11 min read

This article walks through the fundamentals of red‑black trees, explains their equivalence to 2‑3‑4 trees, details insertion and deletion rules, compares their performance to plain binary search trees, and shares practical debugging tips for implementing a balanced tree in code.
2-3-4 TreeAlgorithmData Structures
0 likes · 12 min read

This article explains the fundamentals of tree data structures—including general trees, binary trees, AVL balanced trees, and red‑black trees—covering their definitions, node types, properties, rotation techniques, and insertion and deletion algorithms with illustrative code examples.
AlgorithmsData StructuresRed-Black Tree
0 likes · 17 min read

This article explains the concepts, properties, and operations of binary trees, binary search trees, AVL trees, 2‑3 and 2‑3‑4 trees, B‑trees, and especially red‑black trees, illustrating how they maintain balance through rotations and why they are widely used in ordered data storage.
AlgorithmsBalanced TreesData Structures
0 likes · 12 min read

This article introduces binary trees, binary search trees, and various self‑balancing trees such as AVL, 2‑3, 2‑3‑4, B‑trees, and explains the structure, properties, rotations, and common applications of red‑black trees in a clear, illustrated manner.
AlgorithmsData StructuresRed-Black Tree
0 likes · 12 min read

An illustrated guide walks readers through the fundamentals of red‑black trees, explaining binary search tree basics, their limitations, and the red‑black tree’s balancing operations—including node rotations, insertion, and deletion cases—while providing complete source code tested with massive random operations.
AlgorithmsData StructuresIllustrated Tutorial
0 likes · 5 min read

This article explains the internal design of Java's ConcurrentHashMap, covering its evolution from JDK7 to JDK8, the segment‑based locking mechanism, lock‑free reads, CAS operations, table resizing, treeification, and the key classes and methods that enable efficient concurrent access while maintaining thread safety.
CASConcurrentHashMapLock Splitting
0 likes · 42 min read

The article investigates a CPU load spike caused by a red‑black tree cycle inside Java's HashMap after JDK 8, detailing monitoring steps, stack‑trace analysis, heap dump inspection, and concluding with a recommendation to replace HashMap with ConcurrentHashMap in concurrent scenarios.
CPU spikeConcurrencyDebugging
0 likes · 4 min read

This article explains the concepts, properties, and operations of binary trees, binary search trees, AVL trees, 2‑3 and 2‑3‑4 trees, B‑trees, and red‑black trees, illustrating how they maintain balance, avoid degeneration, and are applied in modern software systems.
AVL TreeB-treeRed-Black Tree
0 likes · 10 min read

This article explains Java's TreeMap implementation, detailing its underlying red‑black tree structure, the essential fields and inner Entry class, and step‑by‑step analyses of the put, get, and remove methods along with their self‑balancing algorithms and traversal techniques.
AlgorithmsJavaRed-Black Tree
0 likes · 20 min read

This article explains the internal structure and behavior of Java's HashMap, covering its node and tree node classes, default parameters, hash calculation, resizing mechanism, and the conditions under which linked lists are transformed into red‑black trees, along with code examples and performance considerations.
HashMapJavaRed-Black Tree
0 likes · 22 min read

This article provides a comprehensive tutorial on red‑black trees, covering binary search tree fundamentals, the five classic insertion cases, recoloring rules, left and right rotations, and a step‑by‑step example of inserting a new node while preserving all red‑black properties.
AlgorithmsData StructuresInsertion
0 likes · 8 min read

This article provides a comprehensive, step‑by‑step explanation of red‑black tree insertion, covering binary search tree basics, red‑black properties, the five insertion cases, color changes, left and right rotations, and detailed visual examples to help readers fully master the data structure.
BalancingData StructuresInsertion
0 likes · 8 min read


政采云技术Apr 6, 2020 · Fundamentals
This article provides a comprehensive, step‑by‑step explanation of red‑black tree deletion, covering node search, replacement strategies, nine deletion cases with detailed rotations and recoloring, accompanying JavaScript code, and real‑world applications in Java, Nginx, and Linux kernels.
AlgorithmsData StructuresRed-Black Tree
0 likes · 20 min read

This article provides a comprehensive, image‑rich tutorial on red‑black trees, covering their definition, five core properties, node naming conventions, rotation and recoloring operations, detailed search algorithms, step‑by‑step insertion and deletion cases with visual illustrations, and answers to thought‑provoking exercises.
AlgorithmsData StructuresInsertion
0 likes · 25 min read


政采云技术Dec 22, 2019 · Fundamentals
This article provides a clear, illustrated introduction to red‑black trees, covering their definition, fundamental properties, binary search tree background, traversal methods, rotation and recoloring techniques, and detailed insertion scenarios with JavaScript code examples, preparing readers for further study of deletions.
AlgorithmsData StructuresInsertion
0 likes · 19 min read

This article provides a comprehensive overview of red‑black trees, covering the underlying concepts of binary trees, binary search trees, balanced trees such as AVL, the five red‑black properties, insertion and deletion algorithms with color changes and rotations, and a detailed Java TreeMap source‑code illustration.
BalancingData StructuresInsertion
0 likes · 23 min read

An interview-style dialogue explains the distinctions between TreeSet and HashSet, the underlying implementations of HashMap versus TreeMap, and how red‑black trees provide balanced performance, covering hash collisions, treeification, and thread‑safety considerations in Java collections.
Data StructuresHashMapJava
0 likes · 6 min read

This article explains the fundamentals of red‑black trees, a self‑balancing binary search tree, covering their properties, recolor and rotation operations, step‑by‑step insertion cases, and practical questions such as Java 8 HashMap usage and deletion rules.
AlgorithmsData StructuresRed-Black Tree
0 likes · 8 min read

This article offers a clear, visual introduction to red‑black trees, covering binary search tree fundamentals, the four balancing rules, insertion cases with recolor and rotation steps, and step‑by‑step animated examples, helping readers grasp and remember the concepts through images and analogies.
AlgorithmBalancingData Structures
0 likes · 10 min read

This article explains the balanced binary search tree known as a red‑black tree, detailing its five defining properties, illustrating insertion examples that maintain balance, and describing left and right rotation operations with visual aids to help readers grasp the underlying algorithms.
AlgorithmsRed-Black TreeTree Rotations
0 likes · 4 min read

This article explains the fundamentals of the ngx_rbtree_t red‑black tree used in Nginx, covering its origin from 2‑3 trees, core properties, insertion and deletion algorithms, rotation and recoloring operations, and provides source‑code analysis with illustrative diagrams.
AlgorithmsNginxRed-Black Tree
0 likes · 16 min read

This article explains the internal mechanics of Java's ConcurrentHashMap when a bucket’s linked list exceeds the TREEIFY_THRESHOLD, detailing how the structure is converted into a red‑black tree, the treeifyBin implementation, node insertion cases, rotation operations, and the supporting helper methods.
JUCRed-Black Treedata-structures
0 likes · 15 min read

This article describes how Ctrip's risk control system stores static IP location data in memory, transforms it into a red‑black tree for fast lookup, and outlines the data conversion process from database JSON to compact in‑memory structures, achieving high concurrency and low latency.
IP GeolocationRed-Black Treein-memory data structures
0 likes · 14 min read

This article explains how to extend a red‑black tree with a subtree‑size counter to support O(log n) rank and selection operations, detailing the required count updates during insertion, deletion, and tree rotations, and provides complete pseudocode for left/right rotations, rank queries, and element‑by‑rank retrieval.
AlgorithmRed-Black Treeaugmented data structure
0 likes · 6 min read

This article explains binary search trees, their limitations, and introduces red‑black trees as a balanced BST alternative, detailing their properties, node definitions, rotation mechanisms, and step‑by‑step insertion and deletion algorithms with Java code examples and visual illustrations.
AlgorithmsData StructuresJava
0 likes · 19 min read
