首页 / 客观题库
假设 head != nullptr ,下面是实现单向循环链表在头节点后插入新节点的代码,横线处应填入( )。
1
2
3
4
5
6
7
8
9
10
struct Node {
int val;
Node* next;
};
void insertAfterHead(Node* head, int x) {
Node* newNode = new Node;
newNode->val = x;
______________________ // 在此处填入代码
}
A
newNode->next = head;
head->next = newNode;
B
newNode->next = head->next;
C
D
head = newNode;
18213408360
密码必须包含数字、字母和特殊字符
错误.in文件下载
错误.out文件下载