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:
224
Latest posts
還好我退了 部隊篇
2025/08/08
泡泡
2025/08/05
還好我退了 新訓篇
2025/08/02
大學畢業心得
2025/07/12
AP325 隨筆
2025/06/07
Lycoris Recoil 莉可麗絲
2025/05/04
Catalog
0%