# 解題困難 ## Linked List * Linked List的操作? 像是用curr = head 是將head這個頭的記憶體位置賦予給curr,但之後curr的操作,會改變head後面連接的方式,這個抽象的概念目前只能這樣想。但是用在其他題目時,如果用其他多一點的變數要記錄不同的位置時,還是容易搞錯。 例如要刪除,先用一個新的Node去接後段的LinkedList之類的 更多不懂的觀念在這次[21.Merge Two List](https://hackmd.io/z4nFDp-aQu6bPJ63DcNzgg?view) 裡面的筆記 >搞不懂為何sort_list在操作,最後是return head.next 在 ``` head = sort_list = ListNode(0) ``` >這行時,head , sort_list 被賦予同一個位子嗎? 所以sort_list後面做的事同時會接到head後面嗎? 目前只能這樣理解,但不曉得正確的觀念。 ## 遞迴計算 * 終止條件(這個不同題目要想不同條件,感覺就是需要多練習) 但我是對於while的條件常腦袋會卡住 * 在遞迴時,變數丟到遞迴式中傳遞時,會怎麼樣的被更改 因為在不斷遞迴的過程中, 這個例子應該是我在做[1302.Deepest Leaf Sum](https://hackmd.io/@pSeY7K4aRHigVQRAZA_R6Q/B1ygQsjxK) 時,附在最下面的例子,我一開始的認知是max_layer在遞迴式裡有被條件判斷後更改值, ```python if n_layer > max_layer: max_layer = n_layer result_list.append(node.val) ``` 但是實際上好像沒有?
×
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