链表题目练习推荐

算法 / 2022-08-01

链表题目练习推荐

移除链表元素

 203. 移除链表元素 https://leetcode.cn/problems/remove-linked-list-elements/

32行递归版本:https://github.com/iiiimonster/Datalinkedlistsandalgorithms/blob/master/src/cn/zwy/structure/linkedlist/entity/SingleLinkedList.java#L32

59行普通版本:https://github.com/iiiimonster/Datalinkedlistsandalgorithms/blob/master/src/cn/zwy/structure/linkedlist/entity/SingleLinkedList.java#L59

删除排序链表中的重复元素

83. 删除排序链表中的重复元素 https://leetcode.cn/problems/remove-duplicates-from-sorted-list/

https://github.com/iiiimonster/Datalinkedlistsandalgorithms/blob/master/src/cn/zwy/structure/linkedlist/leetcode/RemoveDuplicatesFromSortedList.java

链表中倒数第k个节点

Offer06 剑指offer22: 链表中倒数第k个节点 https://leetcode.cn/problems/lian-biao-zhong-dao-shu-di-kge-jie-dian-lcof

https://github.com/iiiimonster/Datalinkedlistsandalgorithms/blob/master/src/cn/zwy/structure/linkedlist/leetcode/sword/Offer22.java

从尾到头打印链表

Offer22 剑指offer06:  从尾到头打印链表 https://leetcode.cn/problems/cong-wei-dao-tou-da-yin-lian-biao-lcof/

https://github.com/iiiimonster/Datalinkedlistsandalgorithms/blob/master/src/cn/zwy/structure/linkedlist/leetcode/sword/Offer06.java

单链表反转

1.ReverseLinkedList  单链表反转 https://leetcode.cn/problems/reverse-linked-list/206

https://github.com/iiiimonster/Datalinkedlistsandalgorithms/blob/master/src/cn/zwy/structure/linkedlist/leetcode/ReverseLinkedList.java

链表中环的检测

2.LinkedListCycle  链表中环的检测  https://leetcode.cn/problems/linked-list-cycle/

https://github.com/iiiimonster/Datalinkedlistsandalgorithms/blob/master/src/cn/zwy/structure/linkedlist/leetcode/LinkedListCycle.java3.MergeTwoSortedLists

两个有序的链表合并

3.MergeTwoSortedLists  两个有序的链表合并 https://leetcode.cn/problems/merge-two-sorted-lists/

https://github.com/iiiimonster/Datalinkedlistsandalgorithms/blob/master/src/cn/zwy/structure/linkedlist/leetcode/MergeTwoSortedLists.java4.MiddleOfTheLinkedList

求链表的中间结点

4.MiddleOfTheLinkedList 求链表的中间结点  https://leetcode.cn/problems/middle-of-the-linked-list/

https://github.com/iiiimonster/Datalinkedlistsandalgorithms/blob/master/src/cn/zwy/structure/linkedlist/leetcode/MiddleOfTheLinkedList.java