iT邦幫忙

2025 iThome 鐵人賽

DAY 17
0

題目介紹:

  • 編號:100
  • 類型:tree
  • 難度:easy
  • 題目連結:https://leetcode.com/problems/same-tree/
  • 描述:給定兩棵二元樹 p 和 q,判斷這兩棵樹是否相同。
    相同的定義是:
    (1.) 兩棵樹的結構完全相同

(2.)對應節點的值也完全一樣

解題成功畫面:
https://ithelp.ithome.com.tw/upload/images/20251001/201788405vMWKtuUtG.jpg

notion筆記截圖:
https://ithelp.ithome.com.tw/upload/images/20251001/201788405YlNqwXbzC.jpghttps://ithelp.ithome.com.tw/upload/images/20251001/2017884009SQ3BLrLu.jpg


上一篇
<DAY16> - Maximum Depth of Binary Tree
下一篇
<DAY18> - Invert Binary Tree
系列文
「用 LeetCode 挑戰 30 天,打造扎實的程式邏輯力」- 結合Notion記錄學習筆記19
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言