Skip to content

Create 33 2021 1116 Binary Tree #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions 紀錄/33 2021 1116 Binary Tree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# LeetCode 讀書會第 33 次聚會 2021/11/16

## leetcode 讀書會通知

1. 項目: 第 33 次聚會
2. 目的: 線上一起寫題目, 由有想法的人帶領, 先解題, 再看該題有趣的解法
3. 時間: 11/16 (二) 20:00 ~ 21:00
4. 地點: google meet 線上 (前 10 分鐘預備鏈接)
5. 解題項目: [Binary Tree](https://leetcode.com/explore/learn/card/data-structure-tree/)
6. 共筆: GitHub https://github.com/programmingbookclub/Leetcode-club
7. 備註:

上次聊了一些 Traversal 的解法(Pre/In/Post order), 有一個 Todo,一個 regret
TODO: 不太懂 iterative 在幹什麼,看有沒有辦法用比較易懂的方式講 iterative
REGRET:Google Meet 上面的聊天室忘了備份

關於 TODO,希望可以先蒐集大家的回答(事先留言/現場回應)。這次聚會預期的目標是:
> 1. 回顧 recursion 如何轉換成 iteration
> 2. 102 持續討論 recursion 與 iteration
> 3. 104 101 112 以看到題目的第一個想法為主
> 4. 希望可以聊到 4 題 102、104、101、112

* MEDIUM 102 Binary Tree Level Order Traversal https://leetcode.com/problems/binary-tree-level-order-traversal
* EASY 104 Maximum Depth of Binary Tree https://leetcode.com/problems/maximum-depth-of-binary-tree
* EASY 101 Symmetric Tree https://leetcode.com/problems/symmetric-tree
* EASY 112 Path Sum https://leetcode.com/problems/path-sum
* MEDIUM 106 Construct Binary Tree from Inorder and Postorder Traversal https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal
* MEDIUM 105 Construct Binary Tree from Preorder and Inorder Traversal https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal
* MEDIUM 116 Populating Next Right Pointers in Each Node https://leetcode.com/problems/populating-next-right-pointers-in-each-node
* MEDIUM 117 Populating Next Right Pointers in Each Node II https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii
* MEDIUM 236 Lowest Common Ancestor of a Binary Tree https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
* HARD 297 Serialize and Deserialize Binary Tree https://leetcode.com/problems/serialize-and-deserialize-binary-tree

---
Notes:


102- recusion
https://leetcode.com/problems/binary-tree-level-order-traversal/discuss/1413730/Binary-Tree-Level-Order-Traversal%3A-Java-Recursive-Solution


DinDin下午8:28
想問用iteratively優勢是會比較快是嗎? 當初做都是用 recursively一路寫到底
DinDin下午8:32
好喔 謝謝
PENG YU下午8:36
查一下網路recursively好像用起來代價然比較大.(記憶體資源)然後比較慢.

https://stackoverflow.com/questions/15688019/recursion-versus-iteration


Yu-Lin Wang下午8:38
recursive 優勢應該是解法好懂吧