// 删除单链表指定元素5
#include <iostream>
#include <vector>
using namespace std;
//节点定义:
struct ListNode {
int val;
ListNode* next;
ListNode(int x) : val(x), next(nullptr) {
}
};
class Solution {
public:
ListNode* removeElements(ListNode* head, int val) {
ListNode* dummyHead = new ListNode
C++删除单链表中指定元素
于 2022-04-29 11:44:40 首次发布