梓旭的藏書閣
Home
Search
Archive
About
Zixu
Article
230
Category
5
Tags
25
About
Archive
Search
Category
Tags
Lazy loaded image
學習
樹形DP 隨筆
Post on: Nov 26, 2023
Last edited: Apr 30, 2026
Views
程式
C++
本文目錄
樹形 DPLeetCode 543. Diameter of Binary TreeLeetCode 687. Longest Univalue PathLeetCode 124. Binary Tree Maximum Path SumLeetCode 2246. Longest Path With Different Adjacent CharactersLeetCode 1372. Longest ZigZag Path in a Binary TreeLeetCode
 

樹形 DP

Ref
 

LeetCode 543. Diameter of Binary Tree

  • 通過 Root Node 的最長直徑 ⇒ 左子樹高度 + 右子樹高度

LeetCode 687. Longest Univalue Path

  • 轉化為求 BST 直徑的題目,在判斷式加上限制

LeetCode 124. Binary Tree Maximum Path Sum

LeetCode 2246. Longest Path With Different Adjacent Characters

  • 非 BST ⇒ 用 Graph 來儲存樹的資訊

LeetCode 1372. Longest ZigZag Path in a Binary Tree

LeetCode

 
  • Author:Zixu
  • URL:https://zixu.eu.org/article/樹形DP_隨筆
  • Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts
Lazy loaded image
AP325 隨筆
Lazy loaded image
JPS 學習筆記
Lazy loaded image
登入頁面實作
Lazy loaded image
Java Web 入門課
Lazy loaded image
Spring 入門課
Lazy loaded image
Java 入門課
NeetCode題單 隨筆區間DP 隨筆
Loading...
Catalog
0%
樹形 DPLeetCode 543. Diameter of Binary TreeLeetCode 687. Longest Univalue PathLeetCode 124. Binary Tree Maximum Path SumLeetCode 2246. Longest Path With Different Adjacent CharactersLeetCode 1372. Longest ZigZag Path in a Binary TreeLeetCode
Zixu
Zixu
Welcome to my webstie.
Article
230
Category
5
Tags
25
Analytics
Post Count:
230
pv:
uv:
Latest posts
JPS 學習筆記
JPS 學習筆記
Apr 30, 2026
AP325 隨筆
AP325 隨筆
Apr 30, 2026
登入頁面實作
登入頁面實作
Apr 30, 2026
Java Web 入門課
Java Web 入門課
Apr 30, 2026
Spring 入門課
Spring 入門課
Apr 30, 2026
Java 入門課
Java 入門課
Apr 30, 2026
Catalog
0%
樹形 DPLeetCode 543. Diameter of Binary TreeLeetCode 687. Longest Univalue PathLeetCode 124. Binary Tree Maximum Path SumLeetCode 2246. Longest Path With Different Adjacent CharactersLeetCode 1372. Longest ZigZag Path in a Binary TreeLeetCode
2021-2026Zixu.

梓旭的藏書閣 | Welcome to my webstie.

Powered byNotionNext 4.10.8.