LeetCode p203 Remove Linked List Elements 题解
1.题目:
Remove all elements from a linked list of integers that have value val.
Example
Given: 1 –> 2 –> 6 –> 3 –> 4 –> 5 –> 6, val = 6
Return: 1 –> 2 –> 3 –> 4 –> 5
题意:
去除链表中指定元素。
2.解题思路:
见代码
3.代码
1 |
|