目录
Leetcode019删除链表的倒数第N个数--------快慢指针:
地址:
描述:?(进阶扫描一次实现)
题解:
Leetcode083?删除排序链表中的重复元素
描述:
?代码:
Leetcode061(旋转链表)--------快慢指针
描述:
?题解:
Leetcode024两两交换链表中的节点-------(for循环的妙用&&链表接连的顺序)
描述:
?题解:
Leetcode019删除链表的倒数第N个数--------快慢指针:
地址:
https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/
描述:?(进阶扫描一次实现)
题解:
https://blog.csdn.net/qq_52934831/article/details/119675084
描述:
?代码:
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode() {}
* ListNode(int val) { this.val = val; }
* ListNode(int val, ListNode next) { this.val = val; this.next = next; }
* }
*/
class Solution {
public ListNode deleteDuplicates(ListNode head) {
ListNode p=head;
if(head==null) return head;
while(p.next!=null){
if(p.val==p.next.val){
p.next=p.next.next;
}
else p=p.next;
}
return head;
}
}
Leetcode061(旋转链表)--------快慢指针
描述:
?题解:
https://blog.csdn.net/qq_52934831/article/details/119676437
Leetcode024两两交换链表中的节点-------(for循环的妙用&&链表接连的顺序)
描述:
?题解:
https://blog.csdn.net/qq_52934831/article/details/119683895
|