王皓立
演算法作業 HW10
Try
HackMD
王皓立
·
Follow
Last edited by
王皓立
on
May 8, 2024
Linked with GitHub
Contributed by
0
Comments
Feedback
Log in to edit or delete your comments and be notified of replies.
Sign up
Already have an account? Log in
There is no comment
Select some text and then click Comment, or simply add a comment to this page from below to start a discussion.
Discard
Send
演算法作業 HW10
本週進入到第5章後半,樹搜尋延伸至A*演算法。
觀念題
Image Not Showing
Possible Reasons
The image file may be corrupted
The server hosting the image is unavailable
The image path is incorrect
The image format is not supported
Learn More →
第1題: 01背包問題
已知有六個物品,其價值和重量如下,背包重量限制為34。
Image Not Showing
Possible Reasons
The image file may be corrupted
The server hosting the image is unavailable
The image path is incorrect
The image format is not supported
Learn More →
仿照課本以tree search來解。
請將下圖中的框框中,填入其upper bound與lower bound
Image Not Showing
Possible Reasons
The image file may be corrupted
The server hosting the image is unavailable
The image path is incorrect
The image format is not supported
Learn More →
第2題: A* 解multi-stage shortest path problem
請使用A* 找出S到T的最短路徑。請畫出樹狀圖,並標示各點的cost,並註明哪裏分枝不用再繼續尋找了。
Image Not Showing
Possible Reasons
The image file may be corrupted
The server hosting the image is unavailable
The image path is incorrect
The image format is not supported
Learn More →
第3題: Channel Routing Problem
請使用A* 解Channel Routing Problem。
本題將原本題目的net 7移除,只剩下7個nets,請找出最少track的安排方式。
Image Not Showing
Possible Reasons
The image file may be corrupted
The server hosting the image is unavailable
The image path is incorrect
The image format is not supported
Learn More →
程式題:
Image Not Showing
Possible Reasons
The image file may be corrupted
The server hosting the image is unavailable
The image path is incorrect
The image format is not supported
Learn More →
主題:
Breadth-First Search
第4題: 合併二元樹
Merge Two Binary Trees - LeetCode
題目:給定二個二元樹,請建立一個合併兩者的二元樹
這題可以用DFS也可用BFS,都可以試試看。
第5題: 最深葉子的最低共同祖先
Lowest Common Ancestor of Deepest Leaves - LeetCode
所謂Lowest Common Ancestor(最低共同祖先),舉例來說,下圖中xy的最低共同祖先就是深綠色的點。
若當只有一個點時,該點的LCA就是自己。
例如x的最低共同祖先就是x。
Image Not Showing
Possible Reasons
The image file may be corrupted
The server hosting the image is unavailable
The image path is incorrect
The image format is not supported
Learn More →
題目:給定一個二元樹,找出該二元樹最深的葉子之最低共同祖先
建議以BFS來作。
例如下圖中,最深的葉子為7,4,而LCA就是2。
Image Not Showing
Possible Reasons
The image file may be corrupted
The server hosting the image is unavailable
The image path is incorrect
The image format is not supported
Learn More →
第6題:
Binary Tree Pruning - LeetCode
題目:給定一個二元樹,刪除不含1的子樹
Image Not Showing
Possible Reasons
The image was uploaded to a note which you don't have access to
The note which the image was originally uploaded to has been deleted
Learn More →
第7題 : 心得
請在以下表單填寫對本週(hw10)影片教學和程式作業的問題/收穫/適應程度/心得。
https://forms.gle/3FqW22n3ViN98jbZ9
演算法作業 HW10
觀念題
第1題: 01背包問題
第2題: A* 解multi-stage shortest path problem
第3題: Channel Routing Problem
程式題:
第4題: 合併二元樹
第5題: 最深葉子的最低共同祖先
第6題:
第7題 : 心得
Expand all
Back to top
Go to bottom
演算法作業 HW10
觀念題
第1題: 01背包問題
第2題: A* 解multi-stage shortest path problem
第3題: Channel Routing Problem
程式題:
第4題: 合併二元樹
第5題: 最深葉子的最低共同祖先
第6題:
第7題 : 心得
Expand all
Back to top
Go to bottom
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up
Comment