摘要:
Sort a linked list using insertion sort. 链表的插入排序 思路,递归到链表尾,然后循环插入; 阅读全文
摘要:
Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, 阅读全文
摘要:
Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 -- 阅读全文
摘要:
Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 思路:快慢指针,设置一个走两步的快指针,和一个走一步的慢指针,如果有环,则它们一 阅读全文