帮帮小小佬吧
  • 板块学术版
  • 楼主AC11msmb
  • 当前回复0
  • 已保存回复0
  • 发布时间2024/9/3 21:00
  • 上次更新2024/9/4 10:41:12
查看原帖
帮帮小小佬吧
1419757
AC11msmb楼主2024/9/3 21:00

谁能给我一些关于链表的东西,看到这题我蒙了```cpp 第 4 题 下⾯的代码⽚段⽤于在双向链表中删除⼀个节点。请在横线处填⼊( ),使其能正确实现相应功能。 1 void deleteNode(DoublyListNode*& head, int value) { 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 A. B. C. D. DoublyListNode* current = head; while (current != nullptr && current->val != value) { current = current->next; } if (current != nullptr) { if (current->prev != nullptr) { ____________________________________ // 在此处填入代码 } else { head = current->next; } if (current->next != nullptr) { current->next->prev = current->prev; } delete current; } } if (current->next != nullptr) current->next->prev = current->prev; current->prev->next = current->next; delete current->next; current->prev = current->next

类似这种的教程文字
2024/9/3 21:00
加载中...