Tagged articles
Tree Structure
19 articles · Page 1 of 1
The article explains how the Composite pattern solves the pain of handling tree‑like structures—such as orders with nested packages—by providing a uniform component interface that eliminates instanceof checks, discusses transparent vs safe variants, shows real‑world library examples, and outlines when the pattern is appropriate.
Composite PatternDesign PatternsJava
0 likes · 14 min read


liandkJun 22, 2026 · Fundamentals
This article introduces the Composite design pattern, explains its purpose of treating leaf and container objects uniformly, shows typical tree‑structured use cases, and provides a complete Java implementation with abstract component, leaf, composite, and a test demo.
Composite PatternDesign PatternsJava
0 likes · 5 min read

The article examines common pitfalls of using a simple parent_id column for menu hierarchies, compares three storage models—adjacency list, path enumeration, and closure table—shows their trade‑offs, and provides a SpringBoot/MyBatis‑Plus implementation that combines adjacency and closure tables for optimal read‑write performance.
Adjacency ListBackendClosure Table
0 likes · 14 min read

This article explains how to design a flexible TreeNode interface and a TreeUtil class in Java that convert flat collections into hierarchical tree structures, provides multiple static methods for object and JSON tree generation, and discusses optimization techniques for large data sets.
Data StructuresJavaTree Structure
0 likes · 10 min read

This article explains how to create a unified SpringBoot utility class that builds hierarchical structures such as multi‑level menus, comments, departments, and categories, discusses database design choices like the optional tree_path field, provides a detailed ITreeNode interface, implementation of TreeNodeUtil with code examples, and demonstrates testing and filtering scenarios.
JavaMulti-level MenuSpringBoot
0 likes · 12 min read

This article explains how to construct hierarchical tree data in Java without using recursion by adapting the non‑recursive algorithm from the zTree jQuery plugin, detailing the underlying hash‑map approach, providing full Java code, and discussing performance benefits and limitations.
AlgorithmHashMapJava
0 likes · 12 min read

This article demonstrates how to efficiently build department and regional hierarchical trees in Java by fetching all records in a single database query, using Stream API, Lambda expressions, in‑memory grouping, Redis caching and RocketMQ for asynchronous updates, achieving sub‑second response times even with tens of thousands of nodes.
BackendJavaRocketMQ
0 likes · 11 min read

The article explains how to implement a red‑dot badge system in the “玩心部落” mobile app using a tree‑structured RedPoint hierarchy combined with the Observer pattern, where each node tracks its count, notifies UI observers, propagates updates to parent nodes, and is managed centrally by a HeadRedPoint singleton for easy extension.
JavaMobile DevelopmentObserver Pattern
0 likes · 12 min read

This article explains how to replace inefficient recursive MySQL tree queries with the nested‑set (preorder traversal) technique, covering descendant retrieval, subtree counting, leaf detection, insertion, deletion, direct‑child lookup, ancestor path queries, and a JavaScript example for building a tree structure.
Hierarchical QueryMySQLSQL
0 likes · 12 min read

This article narrates the step‑by‑step evolution of a custom workflow engine, detailing how simple sequential approvers were transformed into a tree‑structured system supporting parallel, multi‑sign, conditional, delegation, and nested nodes, complete with status management and progress metrics.
BackendDesignNode
0 likes · 9 min read

This article demonstrates how to transform a flat list into a hierarchical tree structure in Java by defining a NodeVO class, implementing a recursive Stream‑based conversion method, and testing it with sample data, showcasing the elegance of the Stream API over traditional loops.
Stream APITree Structurebackend development
0 likes · 4 min read

This article explains how to use the nested set (left‑right) model to efficiently query, count, and manipulate hierarchical department data in MySQL, providing SQL examples for retrieving descendants, ancestors, leaf detection, as well as insert, delete, and JavaScript tree‑building techniques.
MySQLNested Set ModelSQL
0 likes · 11 min read

This article demonstrates how to retrieve flat menu data from a database into a List, then use Java 8 Stream operations and recursive methods to assemble a hierarchical tree structure, printing the result as JSON for verification.
BackendJavaTree Structure
0 likes · 4 min read

Seq2Path treats each sentiment tuple as an independent tree path, training with average path loss and decoding via constrained beam search with a discriminative token, achieving state‑of‑the‑art results on five aspect‑based sentiment analysis datasets and deployment in Alibaba Entertainment AI Brain.
ACLSeq2SeqTree Structure
0 likes · 3 min read

This article walks through the step‑by‑step design of a workflow engine, starting with a basic approval chain and progressively adding countersign, parallel, conditional, delegation, timeout, scripting, and progress‑tracking features, illustrating a tree‑based architecture and node‑state management.
DesignNodeTree Structure
0 likes · 12 min read

This article shares a generic Java utility class that recursively constructs hierarchical tree structures from a flat list by using functional interfaces to identify parent‑child relationships, optionally sorting nodes, and providing a flexible way to set child collections.
GenericsJavaTree Structure
0 likes · 4 min read

This article explains the Composite (part‑whole) design pattern in Go, illustrates its concept with natural and file‑system analogies, and provides complete Go code demonstrating how files and folders can be treated uniformly as tree nodes.
Composite PatternDesign PatternsGo
0 likes · 6 min read

This article explains the Composite design pattern, detailing its definition, benefits, and implementation through JavaScript examples such as a startup command sequence and an employee‑department hierarchy, while highlighting key considerations, common pitfalls, and best practices for effective use.
Composite PatternTree Structuresoftware architecture
0 likes · 9 min read

Recursive Neural Networks (RNN) extend deep learning to tree and graph structures, using Back‑Propagation Through Structure (BPTS) for training; this article explains their theory, forward and backward computations, implementation details, code snippets, and applications in natural language and scene parsing, while noting practical challenges.
BPTSDeep LearningRecursive Neural Network
0 likes · 15 min read
