status
date
slug
tags
category
type
password
icon
本文目錄
 
 
 

樹形 DP

 

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

 
 
雙指標 隨筆DP系列問題 隨筆
Loading...
Catalog
0%
Zixu
Zixu
Welcome to my webstie.
Analytics
Post Count:
226
Latest posts
碧藍之海
2025/09/26
還好我退了 新訓篇
2025/09/25
AP325 隨筆
2025/09/24
復活魔法
2025/09/16
還好我退了 部隊篇
2025/09/14
學院生存指南
2025/09/06
Catalog
0%