-->
当前位置:首页 > 题库 > 正文内容

Multiple choice:Let `h` be the head of a singly linked list without a dummy head

Luz3年前 (2021-05-10)题库472
Let `h` be the head of a singly linked list without a dummy head node. To insert a new node `t` as the first node, we must do: @[D](2)
A. `h=t; t->next=h->next;`
B. `t->next=h->next; h=t;`
C. `h=t; t->next=h;`
D. `t->next=h; h=t;`




A.`h=t; t->next=h->next;`
B.`t->next=h->next; h=t;`
C.`h=t; t->next=h;`
D.`t->next=h; h=t;`


answer:D

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。