Skip to main content
David Liu
Home
Algorithms
Overview
Data Structures
Linear
Tree
Graph
Set
Search
DFS
BFS
FOR
Optimization
Decrease & Conquer
Dynamic Programming
Math
Study Tracks
JZ Track
Problem-Solving Framework
FAQ
AI Systems
Overview
Foundations
Overview
Classical ML
Deep Learning
Language Models
Reinforcement Learning
Generative AI
Overview
Text & Pre-Training
Training Systems
Alignment
Inference
Multimodal
RAG
Agents
AI Engineering
Recommender Systems
Retrieval
Pre-Ranking
Ranking
Re-Ranking
Metrics
Cold Start
PyTorch
Search Systems
AI Evaluation
AI Safety
CS Foundations
Overview
Systems Foundations
Computer Networks
Operating Systems
Software & System Design
Object-Oriented Design
Design Patterns
System Design
Software Engineering
Overview
Languages & Runtimes
Overview
Java
Python
Go
C++
Data Systems
Overview
MySQL
Redis
MongoDB
SQL
Middleware
Overview
Kafka
RabbitMQ
Elasticsearch
Nginx
Delivery & Operations
Overview
Unix
Docker
Kubernetes
CI/CD
Application Engineering
Quality & Tooling
Observability
Software Testing
Engineering Tools
Test Prep
Overview
TOEFL iBT
Overview
Reading
Listening
Speaking
Writing
GRE General Test
Overview
Verbal
Quantitative
Analytical Writing
Language Foundations
Archive
Course Notes
Personal Notes
All Articles
Tags
树形动态规划
David Liu
8/23/26
Less than 1 minute
树形动态规划
树形 DP 在后序遍历中汇总子树状态,再把局部结果组合成当前节点的状态。
树上型 DP
先说明每个返回值对“以当前节点为根的子树”代表什么,再处理父子状态的兼容关系。
Next
树上型