测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A18423. 下面代码遍历并输出一个循环单链表,其中 head 指向链表的第一个节点,横线处应填入的是( )。struct Node { int val; Node* next; }; void printList(Node* head) { if (head == nullptr) return; Node* p = head; _______________________ // 在此处填入代码 cout…

单选题 困难

题目描述

下面代码遍历并输出一个循环单链表,其中 head 指向链表的第一个节点,横线处应填入的是(    )。

struct Node {
	int val;
	Node* next;
};
void printList(Node* head) {
	if (head == nullptr) return;
	Node* p = head;
	_______________________ // 在此处填入代码
	cout << endl;
}

选项(单选)

上一题 下一题