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
- Author:Zixu
- URL:https://zixu.us.kg/article/樹形DP_隨筆
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!