or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
2020q3 Week1
課堂問答簡記
ccs100203
Q: 將
add_entry
裡的new_node
插在head
的前面要怎麼改?如果傳進來的是前面 node 的 next 的 reference,那直接 dereference 後接上去就可以了
e.g.
add_entry(&(head->next), 109);
但如果不是的話,e.g.
node_t *head2 = head->next; add_entry(&head2, 109);
,就變成用下面的方法,加一個 node 在後面,然後把資料移過去ZhuMon
Q 如何改 reverse 為 pointer to pointer
tigger12613
Q 將
add_entry
裡的new_node
插在 list 的最前面要怎麼改? (head前面可能還有node,請在確保整體linked list依舊正常的情況下在head前面插入new_node
.另外,不可新增傳入的參數)我贊同
ccs100203
的方法,以下內容皆參考ccs100203
的答案head'
是參數的(*head)我們並不知道紫色的那些東西存不存在,所以新增一個 node ,把 node2 的 value 丟給 new node
copy value of node2 to new node
copy the new value to node2
這樣就可以在維持 link list 的正確性的情況下,插入一個node