| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 12791 | 電機系上機考3 |
|
Description
考試時,請也連上課時的 Teams 連結。
考試作弊嚴重違規。禁止討論、傳訊息、互相幫忙。
所有作業、考試都會檢查。不論任何原因,雷同的程式都沒有分數。
考試時段不要借/出借電腦。
- Anagrams are "變位字" in Chinese
- Our definition of "Tree Anagrams": level-order + In-order traversals
- Brute-forcibly (暴力法) Finding Tree Anagrams
- Given a target tree
- Given some word pairs
- STEP 1. Fill in the tree nodes using the first word. Always in level-order
- STEP 2. In-order traverse the tree with empty nodes ignored
- STEP 3. Answer if the traversal matches the second word
Example
- Given a tree and a word pair:
- The steps
Input
More explanations of the heap format