第20816题 单选题
C++双向链表头插新节点时空白处应填入的代码为?

小杨想在双向链表中加入一首新歌曲,将其作为链表的第一首歌曲,则下面横线上应填入的代码为( )。

void insert(dl_node *head, string my_song) {
  p = new dl_node;
  p->song = my_song;
  p->prev = nullptr;
  p->next = head;

  if (head != nullptr) {
    ________________________________ // 在此处填入代码
  }
  head = p;
}
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析